Spatialite相关知识备忘录

select AsGeoJSON(GeomFromText('POINT(-118.4 -45.2)'))

select AsGeoJSON(GeomFromText('POLYGON((10172081.707086032 3426616.2980572497,10181098.35305895 3439876.071546833,10188842.060776865 3423858.265171416,10172081.707086032 3426616.2980572497))'))

SELECT ROWID, * FROM "G_Illegal" where MbrIntersects(BuildMBR(-21279.791016, 12145.662598, -21259.791016, 12165.662598),Geometry) ORDER BY ROWID

SELECT ROWID, * FROM "G_Illegal" where MbrIntersects(BuildCircleMbr(-21269.791016, 12155.662598, 10),Geometry) ORDER BY ROWID

SELECT ROWID, * FROM "G_Illegal" where MbrIntersects(GeomFromText('MULTIPOLYGON(((-21269.791016 12155.662598, -33299.973 284.211, -33319.457 287.831, -33305.874 338.033, -33287.051 333.155)))'),Geometry) ORDER BY ROWID

SELECT ROWID, Distance(GeomFromText('POINT(-21269.791016 12155.662598)'),Geometry) FROM "G_Illegal" ORDER BY ROWID

/** POINT */
WKT:
POINT(-118.4 -45.2)
GeoJSON:
{"type":"Point","coordinates":[-118.4,-45.2]}

/** MULTIPOINT */
WKT:
MULTIPOINT(1.01 2.02, 2.01 3.01)
GeoJSON:
{"type":"MultiPoint","coordinates":[[1.01,2.02],[2.01,3.01]]}

/** LINESTRING */
WKT:
LINESTRING(668540.706869 4858267.857562, 668545.871539 4858270.322537, 668535.504206 4858270.059492)
GeoJSON:
{"type":"LineString","coordinates":[[668540.706869,4858267.857561999],[668545.8715389999,4858270.322536999],[668535.504206,4858270.059492]]}

/** MULTILINESTRING */
WKT:
MULTILINESTRING((668540.706869 4858267.857562,668545.871539 4858270.322537),(668535.504206 4858270.059492, 668535.504206 4858270.059492))
GeoJSON:
{"type":"MultiLineString","coordinates":[[[668540.706869,4858267.857561999],[668545.8715389999,4858270.322536999]],[[668535.504206,4858270.059492],[668535.504206,4858270.059492]]]}

/** POLYGON */
WKT:
POLYGON((10172081.707086032 3426616.2980572497,10181098.35305895 3439876.071546833,10188842.060776865 3423858.265171416,10172081.707086032 3426616.2980572497))
GeoJSON:
{"type":"Polygon","coordinates":[[[10172081.70708603,3426616.298057249],[10181098.35305894,3439876.071546832],[10188842.06077686,3423858.265171416],[10172081.70708603,3426616.298057249]]]}

/** MULTIPOLYGON */
WKT:
MULTIPOLYGON(((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2)),((3 3,6 2,6 4,3 3)))
GeoJSON:
{"type":"MultiPolygon","coordinates":[[[[1,1],[5,1],[5,5],[1,5],[1,1]],[[2,2],[3,2],[3,3],[2,3],[2,2]]],[[[3,3],[6,2],[6,4],[3,3]]]]}

你可能感兴趣的:(Spatialite相关知识备忘录)