ResidentMario / geoplot

High-level geospatial data visualization library for Python.
https://residentmario.github.io/geoplot/index.html
MIT License
1.15k stars 95 forks source link

Fix Voronoi reference example #257

Closed ResidentMario closed 3 years ago

ResidentMario commented 3 years ago

193 made it so that duplicate points in the geometry passed into voronoi would raise a ValueError. This is correct behavior the Voronoi algorithm requires that no too points have the same coordinate value, but it broke one of the plot reference renderers.

The fix I've made here is applying gplt.ops.jitter_points to the input data first. This uniquifies the points by applying a small random jitter to them.

gplt.ops.jitter_points is done for you automatically, if needed, for input passed to the quadtree plotter. This PR updates the behavior of the voronoi plotter to do the same.