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
780 stars 192 forks source link

How to use JTS Queries #387

Open stolarinhoo opened 2 years ago

stolarinhoo commented 2 years ago

Hi, I found in documentation topic about querying. Is it exist any tutorial how deal with this library? Is it possible use these methods on WKT objects, particularly regarding to 3D cartesian coordinates?

Thank You in advance, Jakub

craigtaverner commented 2 years ago

This library does not really deal with 3D coordinate systems. It is based on JTS and GeoTools and was originally written using versions of those libraries that did not provide good support for 3D. Some early work was done to support 3D, but it is far from complete. Neo4j itself, however, provides complete 3D support for Cartesian points, but not for complex geometries.

However, we did add some support for CQL querying of layers, whether they use WKT or not. This support is wrapped in a concept called Dynamic Layers. This means you define a dynamic layer as a subset of a real layer where the subset is the results of a CQL query. This capability is only available using the Java API, so it is not accessible directly from Cypher unless you write your own procedures.

For an example of some basic CQL used to query imported shapefiles, see https://github.com/neo4j-contrib/spatial/blob/master/src/test/java/org/neo4j/gis/spatial/TestDynamicLayers.java#L76

What is your use case? Perhaps adding a procedure to accomplish what you want is not too hard?