问题
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.
回答1:
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
回答2:
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.
来源:https://stackoverflow.com/questions/48145899/geolocation-search-with-gremlin