I have what appears to be a correctly configured spatial layer and index and can successfully query a node using findGeometriesWithinDistance REST API call.
POST /db/data/ext/SpatialPlugin/graphdb/findGeometriesWithinDistance {"layer":"geom","pointX":15.0,"pointY":60.0,"distanceInKm":100.0}
However, when querying using cypher, I get no results (I have tried reversing the order of 60.0 and 15.0 without luck):
START n=node:geom('withinDistance:[60.0, 15.0, 500.0]') return n;
Cyper returns:
==> +---+
==> | n |
==> +---+
==> +---+
==> 0 row
==>
==> 13 ms
REST:
200 OK
==> [ {
==> "paged_traverse" : "http://localhost:7474/db/data/node/14472/paged/traverse/{returnType}{?pageSize,leaseTime}",
==> "outgoing_relationships" : "http://localhost:7474/db/data/node/14472/relationships/out",
==> "data" : {
==> "lon" : 15.2,
==> "bbox" : [ 15.2, 60.1, 15.2, 60.1 ],
==> "RaceName" : "Parador Es Muy Caliente",
==> "lat" : 60.1,
==> "gtype" : 1
==> },
==> "all_typed_relationships" : "http://localhost:7474/db/data/node/14472/relationships/all/{-list|&|types}",
==> "traverse" : "http://localhost:7474/db/data/node/14472/traverse/{returnType}",
==> "self" : "http://localhost:7474/db/data/node/14472",
==> "all_relationships" : "http://localhost:7474/db/data/node/14472/relationships/all",
==> "property" : "http://localhost:7474/db/data/node/14472/properties/{key}",
==> "properties" : "http://localhost:7474/db/data/node/14472/properties",
==> "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/14472/relationships/out/{-list|&|types}",
==> "incoming_relationships" : "http://localhost:7474/db/data/node/14472/relationships/in",
==> "incoming_typed_relationships" : "http://localhost:7474/db/data/node/14472/relationships/in/{-list|&|types}",
==> "extensions" : {
==> },
==> "create_relationship" : "http://localhost:7474/db/data/node/14472/relationships"
==> } ]
REST Calls to reproduce: Create Layer:
POST /db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer { "layer":"geom", "lat":"lat", "lon":"lon" }
Create Index:
POST /db/data/index/node/ {"name":"geom", "config":{"provider":"spatial", "geometry_type":"point","lat":"lat","lon":"lon"}}
Create Node:
POST /db/data/node {"lat":60.2,"lon":15.1,"RaceName":"Parador Es Muy Caliente"}
(In response, examine "self" and find nodeid)
Index the node:
POST /db/data/ext/SpatialPlugin/graphdb/addNodeToLayer {"layer":"geom", "node":"http://localhost:7474/db/data/node/###NEW_NODE_ID###"}
Find:
POST /db/data/ext/SpatialPlugin/graphdb/findGeometriesWithinDistance {"layer":"geom","pointX":15.0,"pointY":60.0,"distanceInKm":100.0}