Thanks Craig for all your informations .... I'll analize in deep in next days :-)
Thank you very much! Gianluca On Sun, Dec 5, 2010 at 11:05 PM, Craig Taverner <cr...@amanzi.com> wrote: > Hi Gianluca, > > I think perhaps my previous answer was too complex, since the link you > provided started with distance queries I answered that, but below you are > more specific, so I will answer again, in-line. > > I understand that for my purpouse Neo4j libraries are uncessary for me. >> > > Since you want an index, you want Neo4j Spatial :-) > > Craig (and excuse me to Anne for the intrusion), could you tell me how >> to managa at best some simple geo coordinates (lat e long) as Neo4j >> nodes ? > > > I would suggest two double properties, latitude and longitude. Then pass > these into the Neo4j Spatial index. > > If you do not want to write any code yourself for telling the index how to > understand your node, the SimplePropertyEncoder can do this work for you, so > you do not need to create a mapping between the node and the index. However, > to use SimplePropertyEncoder, you do need to create a Geometry, like a > Point, and pass that in. If you do not want to do that, take a look at > SimplePropertyEncoder, it would be trivial to make a new version of that > class that takes in two float or two doubles. > > >> I only need to store 2 properties (lat e long) some some nodes, then >> to retrieve the nearest points inside a box area with a center defined >> by a lat/long node .... >> Which is the best algorithm to do this ? >> Can I put lat e long as double property in a node, than find it by a >> lucene search ( lat between x and y lat, long between x and y long) ? >> > > I've not tried lucene for this, but if you store the position as lat and > long on two properties in a node, and write a version of the encoder (as > described above), then the RTree index would work on this data, and would be > fast. > > Cheers, Craig > _______________________________________________ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user