I have a database of map points, and I want to limit the display to showing at most ~50 points at a time. When a user zooms in, more points may be displayed.
Currently, I'm just taking a random sample of the result set. This isn't great, as there can be empty areas, that when zoomed in suddenly show a point.
My next thought was I could create a 10x5 grid, and iterate over the results. If a location in the grid was empty, I would show a point. This fixes the previous problem, but also doesn't give the user a sense of where concentrated areas are. Also, this is quite slow if the user decides to zoom out to the entire world.
Right now, I'm not using any spatial algorithm to sort the data. My plan is to get it working right first, and then get it fast. Reading a little into RTress, kd-trees, and quad-trees, I couldn't find anything that would help me select a 'smart' subset of the sample. It seems like there should be some sort of breadth first search which would solve this problem quite easily.