Alireza,

The SpatialDatabaseRecord class holds a reference to the node you created 
when you made the runningLayer.add() call. This node reference is returned 
when you call getGeomNode(). (I assume that the runningLayer is holding WKT 
or WKB geometries - otherwise adding these different geometry types won't 
work.)

Once you get a node with getGeomNode, you do all the same things to it and 
with it that you would do with any other Neo4j node. You can set labels, 
properties, relationships, etc. By the way, there is a different overload 
of the add() method that allows you to set properties on the node as you 
create it.

add(Geometry geometry, String[] fieldsName, Object[] fields)

Hope this helps.

Grace and peace,

Jim

On Thursday, July 24, 2014 7:43:56 AM UTC-4, Alireza Rezaei Mahdiraji wrote:
>
>
> Hi All, 
>
> If I create SpatialDatabaseRecord for spatial nodes how do I create 
> relationships between them? 
>
> patialDatabaseRecord p = 
> runningLayer.add(runningLayer.getGeometryFactory().createPoint(coords1));
> patialDatabaseRecord ls = 
> runningLayer.add(runningLayer.getGeometryFactory().createLineString(coords2));
> ls.getGeomNode().createRelationshipTo(p.getGeomNode(), 
> RelationshipTypes.CONNECTED);
>
> The problem with this apparoach is that getGeomNode() method create an 
> object which does not carry the properties of 
> the original object (I might be wrong on this). 
>
> Is there any other way to link spatial nodes?
>
>
> Thanks,
> Best,
> Alireza
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to