neo4j-contrib / spatial

Neo4j Spatial is a library of utilities for Neo4j that faciliates the enabling of spatial operations on data. In particular you can add spatial indexes to already located data, and perform spatial operations on the data like searching for data within specified regions or within a specified distance of a point of interest. In addition classes are provided to expose the data to geotools and thereby to geotools enabled applications like geoserver and uDig.
http://neo4j-contrib.github.io/spatial
Other
777 stars 191 forks source link

Add a spatial function to convert WKT to Geo-JSON #406

Open Andy2003 opened 1 month ago

Andy2003 commented 1 month ago

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]
]]]