--
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 neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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);
sw.start("findClosestPointsTo");// Check whether we can find a node from which is located within a distance of 250 meters
List<GeoPipeFlow> results = el.findClosestPointsTo(coord, 0.25);sw.stop();
if (logger.isInfoEnabled()) {
logger.info("findClosestPointsTo run in " + sw.getLastTaskTimeMillis() + " millis.");}
--