-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overlapping Voronoi polygons #22
Comments
I believe this shows two distinct issues:
|
With "2 columns", the points are in fact collinear (all belong to the great circle that passes through the poles and [-90;0]). It's one of these situations where the (planar) Delaunay triangulation also tends to fail. A "solution" in that case can be to introduce a supplementary point that is very close to the first point, but not aligned on the same grand circle. (It's frustrating that the code can't compute this case on its own, tho.) |
Yes. Adding the supplementary point works. Thanks @Fil! In my original use case, I had a gridded dataset of more than 2 columns, and I took up d3.geoEquirectangular because it didn't seem like it was stretching/squeezing Vietnam, the country I wanted to visualize, by a whole lot (though I hadn't given that a lot of thought and could be totally wrong). What would you recommend as a replacement for geoEquirectangular? |
It's hard to give a generic recommendation for a projection, it depends so much on the total area you're interested to show (the world or the region), and on the features that are the focus of interest. Sometimes you will want to follow an "official" or usual projection, especially if you have data that comes already projected. Sometimes you will have to use WebMercator, if you use raster tiles. Sometimes a projection designed to be good on land at the expense of the ocean, or the other way around. In any case, I'd say that Equirectangular is a very boring projection, with not many interesting features, and a tendency to vertically "crush" everything that is not on the equator, distorting both the angles and the areas. I would definitely recommend against it, except in very specific cases where you need to align a grid. You can play with http://www.cartography.oregonstate.edu/demos/AdaptiveCompositeMapProjections/ and use the projection that it recommends for the scale you're optimizing for. (They are all available in D3). A transverse Mercator can also be very nice if your focus is on a medium-sized region (or a country), for example https://observablehq.com/@fil/corees-koreas |
Yes! This is exactly what I needed. Thanks! |
Just reading this issue looking for common ground and differences - In comparison to #42. The problems exposed in 42 are found using the orthographic projection ... |
When I tried to create a Voronoi diagram from a gridded dataset of 4 points (±90, ±45) using
geoVoronoi()
, the cells seem to overlap. @Fil has graciously pointed out that this is because the polygons have some 180° edges but no intermediate points.Here's a minimal, reproducible example: https://observablehq.com/d/1433b09bb55a4807. Ideally, each Voronoi cell should be colored either orange or blue. Would love for a way to fix this. Thanks!
The text was updated successfully, but these errors were encountered: