Re: Geo Mapping. How to index/query a non-point geo property?


hadoopmarc@...
 
Edited

Hi Dmitry,

Here you go again:

g.addV().property('location', Geoshape.line([[52, 0] as double[], [52, 2] as double[]]))

g.V().elementMap()
21:09:39 WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [()]. For better performance, use indexes
==>[id:4240,label:vertex,location:LINESTRING (52 0, 52 2)]

gremlin> g.V().has("location", geoWithin(Geoshape.circle(1, 52, 200.0))).elementMap()
==>[id:4240,label:vertex,location:LINESTRING (52 0, 52 2)]

gremlin> g.V().has("location", geoContains(Geoshape.point(1, 52)))
==>v[4240]

As you see, the coordinate order conventions are really warped. This may have led you believe things do not work. I had to find this out too ... Still do not not know which coordinate is latitude and which one longitude :-)

If you want, you can make an issue of it, because the coordinate order for the geoWithin predicate is different for Geoshape.point and Geoshape.circle!

Best wishes,    Marc

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.