spatial icon indicating copy to clipboard operation
spatial copied to clipboard

Add a spatial function to convert WKT to Geo-JSON

Open Andy2003 opened this issue 8 months ago • 0 comments

This PR adds a new spatial function spatial.convert.wktToGeoJson to convert WKT to Geo-JSON.

return spatial.convert.wktToGeoJson("MULTIPOLYGON(((15.3 60.2, 15.3 60.4, 15.7 60.4, 15.7 60.2, 15.3 60.2)))") as json

returns an object like

{
  "type": "MultiPolygon",
   "coordinates", [[[
      [15.3, 60.2],
      [15.3, 60.4],
      [15.7, 60.4],
      [15.7, 60.2],
      [15.3, 60.2]
]]]

Andy2003 avatar May 29 '24 17:05 Andy2003