Neo4j Spatial- two nodes created for every spatially indexed node -
i using neo4j 1.8.2 neo4j spatial 0.9 1.8.2 (http://m2.neo4j.org/content/repositories/releases/org/neo4j/neo4j-spatial/0.9-neo4j-1.8.2/)
followed example code here http://architects.dzone.com/articles/neo4jcypher-finding-football 1 change- instead of spatialindexprovider.simple_wkt_config, used spatialindexprovider.simple_point_config_wkt
everything works fine until execute following query:
start n=node:stadiumslocation('withindistance:[53.489271,-2.246704, 5.0]') return n.name, n.wkt;
n.name null. when explored graph, found data:
node[80]{lon:-2.20024,lat:53.483,id:79,gtype:1,bbox:-2.20024,53.483,-2.20024,53.483]} node[168]{lon:-2.29139,lat:53.4631,id:167,gtype:1,bbox:-2.29139,53.4631,-2.29139,53.4631]}
for node 80 returned, looks node created spatial record, contains property id:79. node 79 actual stadium record example.
as per source of indexprovidertest, comments //we not longer need node 'real' node // node node = db.getnodebyid( (long) spatialrecord.getproperty( "id" ) ); seem indicate feature isn't available in version using.
my question is, recommended way use withindistance other match conditions? there couple of other conditions fulfilled can't seem handle on actual node match them. should explicitly create relations? not use cypher , use core api traversal? split queries?
two options:
a) use geopipline.startnearestneighborlatlonsearch starting set of nodes, supply subsequent cypher query matching/filtering on other properties b) since lat/longs common across many entities [using centroid of area], can create relation spatial node entities located in area , use 1 cypher query such as: start n=node:stadiumslocation('withindistance:[53.489271,-2.246704, 5.0]') match (n)<-[:located_in]-(something) something.someprop=5 return something
as advised peter, went option b. note though, there no way spatially indexed node can create relations it. had withindistance query 0.0 distance.
Comments
Post a Comment