3

Is it possible to do a location search in Gremlin? I can't see how it can be done in the documentation. I specifically want to do the location search in Cosmos Gremlin.

von v.
  • 16,868
  • 4
  • 60
  • 84

2 Answers2

4

Geo location currently is something that is provided by the back end graph system. For example JanusGraph has a GeoSpatial API that can be used with Gremlin. Of course if you store lat/lon coordinates in your graph you can pretty easily write a Gremlin query to use those to look for things based on coordinates.

I have a few examples of doing it manually in section 5.3.8 of the Gremlin tutorial I am writing. Available here: https://github.com/krlawrence/graph

Kelvin Lawrence
  • 14,674
  • 2
  • 16
  • 38
0

There's also a nice Azure Cosmos DB - Graph Api application demo created by Antony Chu which practically does that.

https://github.com/anthonychu/cosmosdb-gremlin-flights

The application is mainly built in 2 parts

-A Console Application which defines Airport object model - Code, Name, GeoCoordinate Coordinate... and generates long/lat coordinates nodes as Vertex.

-An Asp.NET MVC Web application which mainly uses a Bing Map in UI to display Airport nodes from Vertex coordinates and defines linked routes through Edges parameters in GetRoutes function. Hope this helps.

PeteZaria
  • 302
  • 3
  • 9