我有似乎是正确配置的空间层和索引,并且可以使用 findGeometriesWithinDistance REST API 调用成功查询节点。
POST /db/data/ext/SpatialPlugin/graphdb/findGeometriesWithinDistance {"layer":"geom","pointX":15.0,"pointY":60.0,"distanceInKm":100.0}
但是,当使用密码查询时,我没有得到任何结果(我尝试颠倒 60.0 和 15.0 的顺序但没有运气):
START n=node:geom('withinDistance:[60.0, 15.0, 500.0]') return n;
赛珀回报:
==> +---+
==> | n |
==> +---+
==> +---+
==> 0 row
==>
==> 13 ms
休息:
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 调用重现:创建层:
POST /db/data/ext/SpatialPlugin/graphdb/addSimplePointLayer { "layer":"geom", "lat":"lat", "lon":"lon" }
创建索引:
POST /db/data/index/node/ {"name":"geom", "config":{"provider":"spatial", "geometry_type":"point","lat":"lat","lon":"lon"}}
创建节点:
POST /db/data/node {"lat":60.2,"lon":15.1,"RaceName":"Parador Es Muy Caliente"}
(作为回应,检查“self”并找到 nodeid)
索引节点:
POST /db/data/ext/SpatialPlugin/graphdb/addNodeToLayer {"layer":"geom", "node":"http://localhost:7474/db/data/node/###NEW_NODE_ID###"}
寻找:
POST /db/data/ext/SpatialPlugin/graphdb/findGeometriesWithinDistance {"layer":"geom","pointX":15.0,"pointY":60.0,"distanceInKm":100.0}