Hi Michael, thanks for the answer.
I'm using *neo4j 2.0*, *neo4j spatial 0.12-neo4j-2.0.0* and
*neo4j.graph.collections
0.7.1-neo4j-2.0.0* in order to build a route system.
I'ld like to create my own graph model; in my graph model I'ld like to:
-
create nodes and index them by using the spatial index in this way :
GraphDatabaseBuilder gdbb = gdbf.newEmbeddedDatabaseBuilder(neo4jDbPath);
gdbb.setConfig......
Label mainNodeLabel = DynamicLabel.label("nodoPrincipale");
GraphDatabaseService graphDb = gdbb.newGraphDatabase();
SpatialDatabaseService sdb = new SpatialDatabaseService(graphDb);
SimplePointLayer mainPointsLayer =
sdb.createSimplePointLayer("mainPointsLayer", "x", "y");
Schema dbSchema = graphDb.schema();
dbSchema.indexFor(mainNodeLabel).on("x").create();
dbSchema.indexFor(mainNodeLabel).on("y").create();
dbSchema.indexFor(mainNodeLabel).on("giunzioneDbId").create();
org.neo4j.graphdb.Node graphNode = graphDb.createNode(mainNodeLabel);
graphNode.setProperty("y", y);
graphNode.setProperty("x", x);
mainPointsLayer.add(graphNode);
tx.success();
-
create relationships between created nodes :
Relationship rs = startGraphNode.createRelationshipTo(endGraphNode,
relationType);
- *get all closest node from a given point :*
*StopWatch sw = new StopWatch();*
*sw.start("findClosestPointsTo");// Check whether we can find a node from
which is located within a distance of 250 metersList<GeoPipeFlow> results =
el.findClosestPointsTo(coord, 0.25);sw.stop();if (logger.isInfoEnabled()) {
logger.info("findClosestPointsTo run in " + sw.getLastTaskTimeMillis() + "
millis.");}*
*with this log info : *
1.
*"findClosestPointsTo run in 27626 millis" (for the firts time) *
2. * "**findClosestPointsTo run in 2712 millis" (for the second time)*
3.
*"findClosestPointsTo run in 148 millis" (for the third time, after 15
minutes from the second time) *
4. *"findClosestPointsTo run in 698 millis" (for the quarte time, after
15 minutes from the second time).*
*with my intel core I7 machine with 4GB ram.*
*Thanks Antonio*
Il giorno mercoledì 16 aprile 2014 17:59:38 UTC+2, Antonio Grimaldi ha
scritto:
>
> Hi,
> We are using Neo4J 2.0 embedded and have a Graph with around 1 Million of
> Nodes, and 50 Million of relationships;
> When
> call org.neo4j.gis.spatial.SimplePointLayer.findClosestPointsTo(Coordinate,
> double), to get all closest node from a given point, we have very low
> performance.
> Is there a reason for this? or is there any other faster way?
>
> Thanks
> Antonio
>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.