Closed waqas-syed closed 4 years ago
I too would love to see results ordered by distance!
Hey @waqas-syed,
Sorry for the late reply.
Currently, the dynamodbgeo.QueryRadiusRequest gets all of the stored items that fall within the specified radius, but the returned list is not sorted in the order of nearest to farthest point starting from the dynamodbgeo.GeoPoint. It doesn't matter where the provided geopoint is, the resultset is always in the same order sorted as per the calculated geohash attribute. Are there any plans for a feature to get the items in an order of nearest to farthest from a given point inside of a certain radius? Like in the Haversine Formaula?
This sounds like a good feature, I'll add this, thank you for the suggestion.
Secondly, what is the mechanism of the sort order when the items are stored in the DB? The geohash gets generated from a lot of stuff going in the background, but in simple terms, in what manner is the geohash calculated from the coordinates. E.g., from north to south or something along those lines? I couldn't figure a pattern.
Just as many hashing functions, geohash doesn't perserve any order so I don't think it's possible to find a pattern in it.
I got 2 questions:
Currently, the
dynamodbgeo.QueryRadiusRequest
gets all of the stored items that fall within the specified radius, but the returned list is not sorted in the order of nearest to farthest point starting from thedynamodbgeo.GeoPoint
. It doesn't matter where the provided geopoint is, the resultset is always in the same order sorted as per the calculatedgeohash
attribute. Are there any plans for a feature to get the items in an order of nearest to farthest from a given point inside of a certain radius? Like in the Haversine Formaula?Secondly, what is the mechanism of the sort order when the items are stored in the DB? The geohash gets generated from a lot of stuff going in the background, but in simple terms, in what manner is the
geohash
calculated from the coordinates. E.g., from north to south or something along those lines? I couldn't figure a pattern.Great effort in building this. TIA