How can I divide the globe in to small grids such that it allows me to assign each lat/long location to a grid?
geolocation, geospatial, grid, maps, spatial
Solution
Rectangular grids can be a reasonable estimation, but only over a relatively small area that isn't too close to the poles. A full-globe solution requires a different approach.
Problem
In order to calculate the nearest locations that are represented by latitude/longitude, I was considering dividing the map into small grids, approximately 100x100 meter grids. Essentially each point would be assigned to a grid. I understand that I could instead also use spatial indexes with MySQL etc, but am planning to use a non-relational database like Cassandra where it would be difficult to do indexing on spatial objects, and so some kind of grid approximation technique could be neat. What would be the best way of creating such a grid system and mapping the 2-D spatial locations to it? Edit1: It might be alright if the grids are not perfectly uniform, more so around the poles.