I'm assuming these are nodes that represent geometries. In that case you should convert them to the JTS Geometry object and get the length and area from that.
For example, if you did a search with the GeoPipeline, you will return a collection of SpatialDatabaseRecord objects, which contain the node and the geometry. You could do something like: for(SpatialDatabaseRecord record:results) { double length = record.getGeometry().getLength(); double area = record.getGeometry().getArea(); } If you no longer have the SpatialDatabaseRecord, but only the node, you can still convert it to a geometry with: Geometry geom = layer.getGeometryEncoder().decodeGeometry(node); And then call the getLength() and getArea() methods. Check the JTS documentation for more details. On Fri, Sep 19, 2014 at 10:24 AM, Alireza Rezaei Mahdiraji < alireza...@gmail.com> wrote: > > Hi All, > > I need to calculate length and area of given node(s) in two cases: > > 1- for length either a node with line string geometry is given or two > nodes with point geometry > > 2- for polygon either a node with polygon geometry is given or the set of > points of the polygon > as separate point geometries. > > I am aware of GeoPipeline.start( boxesLayer ).calculateLength() but it > seems it computes > for all nodes in a layer while I am interested in given set of nodes (two > cases above). > > > 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. > -- 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.