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

spatial.closest and spatial.withinDistance results not consistent? #375

Open galtay opened 3 years ago

galtay commented 3 years ago

Hello,

neo4j version: 3.5.25 spatial jar file: neo4j-spatial-0.26.2-neo4j-3.5.2-server-plugin.jar

I seem to be getting inconsistent results (or I'm not understanding the procedures) from spatial.closest and spatial.withinDistance. If I load the following shapefile (.shp is available after unzipping) via

https://www2.census.gov/geo/tiger/GENZ2019/shp/cb_2019_01_puma10_500k.zip

spatial.importShapefile

I get 38 nodes and 37 relationships.

When I query with

CALL spatial.withinDistance("cb_2019_01_puma10_500k", {longitude:-88, latitude:30}, 100.0)

I get 4 nodes back.

However, when I query with

CALL spatial.closest("cb_2019_01_puma10_500k", {longitude:-88, latitude:30}, 100.0)

I get zero nodes back. This seems to be the case for any value of distance I use as the final argument. Is this the intended behavior?

best, -Gabriel