Tag Info

Hot answers tagged

17

I see MerseyViking has recommended a quadtree. I was going to suggest the same thing and in order to explain it, here's the code and an example. The code is written in R but ought to port easily to, say, Python. The idea is remarkably simple: split the points approximately in half in the x-direction, then recursively split the two halves along the ...


6

See if this algorithm gives enough anonymity for your data sample: start with a regular grid if polygon has less than threshold, merge with neighbor alternating (E, S, W, N) spiraling clockwise. if polygon has less than threshold, go to 2, else go to next polygon For example, if the minimum threshold is 3:


5

Similarly to Paulo's interesting solution, how about using a quad tree subdivision algorithm? Set the depth you would like the quadtree to go to. You could also have a minimum or maximum number of points per cell so some nodes would be deeper/smaller than others. Subdivide your world, discarding empty nodes. Rinse and repeat until the criteria are met.


1

Another approach is to create a very fine grid, and use the max-p algorithm. http://pysal.readthedocs.org/en/v1.7/library/region/maxp.html



Only top voted, non community-wiki answers of a minimum length are eligible