News for hackers. Stuff that matters.
Re:Show HN: ProximityHash – Geohashes in Proximity by polskibus on Wednesday June 07, 2017 @03:50PM (#14509366)
What's this for?
Re:Show HN: ProximityHash – Geohashes in Proximity by haney on Wednesday June 07, 2017 @04:22PM (#14509579)
I haven't used this specific library, but it's common to want to convert lat/lon into a single dimension where sorting the hash gives nearby locations. This is helpful for lookups/indexing/caching geospatial data. This appears to solve some of those problems.
Re:Show HN: ProximityHash – Geohashes in Proximity by SOLAR_FIELDS on Wednesday June 07, 2017 @04:44PM (#14509710)
Correct. A common use case and straightforward example is reverse geocoding. Using this hash scheme, if your lat long lies in one of the hashed areas (using trivial bounding box computation to determine), there is a very small set of addresses needed to figure out which is the closest. A naive implementation using this indexing scheme might compute the distance to each lat/long in a geospatial database for everything in the indexed bounding box, then return the address with the shortest distance.

Spatial indexing is quite like regular database indexing. If the operation is clever enough to be inexpensive to compute an index with high levels of precision, you gain the advantage of spending less time in the indexing phase of your computation. This becomes relevant when you regularly want to spatially index the entire world, for example.

The only special thing I can see about this particular approach is that it's a circular index, which isn't a common way to approach spatial indexing. The more common approaches such as building R-Tree are rectangular which may not be applicable to all use-cases. Many spatial analyses use circular buffer on point approach (I see this a lot in health fields such as disease analysis), where this specialized approach might eliminate a post-processing step and net some performance gains for the end user.