3

I'm trying to use Amazon Neptune, in my gremlin query I need to filter nearby users and also filter by other relationships, similar to what Tinder (a dating app) does. So I need a geolocation distance calculation into the query. I can't find that feature into the tinkerpop documentation or Neptune documentation. Is it possible to do this? I'm looking for something like "Spatial functions" of Neo4j

Luckily I didn't started the development and didn't decide what DB engine I want to use so if I can't code with this basic tool I'm going to use Neo4j instead of AWS Neptune

Edit: This question has been linked in the comments but does not contain the answer: Geolocation search with Gremlin

I want to know how to make geolocation queries with AWS Neptune

fermmm
  • 1,078
  • 1
  • 9
  • 17

1 Answers1

4

have you looked at this section of Kelvin's book that describes how to do a geolocation search in gremlin? It describes that essentially you capture the longitude and latitude as properties in vertices and then just treat them as long's in your queries.

I am invested into Neptune and will also need to do some simple proximity geospatial searching, though have only gotten as far as capturing lat and long.

I'll want to do something like, find all the vertices that are within ten miles of a point. So I'll use some geospatial library to determine the boundaries of the search and use those numbers in the query.

James Render
  • 1,490
  • 1
  • 14
  • 26
  • That could work, I asked this question to have an opinion on that: https://gis.stackexchange.com/questions/345251/measure-gps-distance-between-two-points-without-using-almost-any-math-not-much – fermmm Dec 17 '19 at 18:34
  • I looked at your question, the part 'find in the same city' - could you do a simple text search for that name? (assuming that you're happy with how this data is being captured in the first instance) – James Render Dec 18 '19 at 09:36
  • No, the "same city" I mentioned is only to get an idea of the kind of distances I'm interested in terms of precision (I edited the post to make it more clear), the name of the city is not useful because I need the distance, a close user could be outside of the city border and should not be excluded – fermmm Dec 18 '19 at 19:39
  • ok, let me know how you get on, and likewise I'll update here when I get round to writing my geospatial search feature but its not likely to be for a couple of months! good luck – James Render Dec 19 '19 at 08:00
  • I asked the question in stackoverflow also: https://stackoverflow.com/questions/59380318/measure-gps-distance-between-two-points-without-using-almost-any-math-accuracy – fermmm Dec 21 '19 at 23:45
  • I plan to add more to Practical Gremlin on this topic. I created an issue that has an example of the Haversine Great Circle Distance formula implemented entirely in Gremlin. https://github.com/krlawrence/graph/issues/169 – Kelvin Lawrence Mar 10 '20 at 01:33