Comments (6)
I believe this shows two distinct issues:
-
when we have 2 columns (and whatever the number of rows), geoVoronoi returns ill-defined polygons.
-
when you request more than two columns, the polygons are OK, but d3.geoEquirectangular (and, it seems, all the projections that rely on antimeridian clipping) fail to display them properly. (You can see that by switching to d3.geoAzimuthalEqualArea in your notebook.)
from d3-geo-voronoi.
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.)
from d3-geo-voronoi.
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?
from d3-geo-voronoi.
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
from d3-geo-voronoi.
Yes! This is exactly what I needed. Thanks!
from d3-geo-voronoi.
I believe this shows two distinct issues:
- when we have 2 columns (and whatever the number of rows), geoVoronoi returns ill-defined polygons.
- when you request more than two columns, the polygons are OK, but d3.geoEquirectangular (and, it seems, all the projections that rely on antimeridian clipping) fail to display them properly. (You can see that by switching to d3.geoAzimuthalEqualArea in your notebook.)
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 ...
which uses circle clipping not antimeridian ... so my only comment is if 1 and 2 are true
then 42 maybe a way to focus on 1.
from d3-geo-voronoi.
Related Issues (20)
- Numeric stability HOT 8
- Geo Voronoi polygons out of triangles HOT 4
- Move to Delaunator@3 HOT 2
- return a clean triangulation HOT 4
- geoHeatmap
- long edges?
- No geoContour in v1.6.0 release. HOT 2
- Would pull requests with typescript *.d.ts definition files be welcome HOT 1
- geo_hull() Use more semantically meaningful Set and Map. HOT 2
- geo_edges: Use the more semantically meaningful Set HOT 3
- Benchmarks: A uniform approach HOT 1
- Extend and correct benchmarking HOT 2
- Add code coverage
- Export base functions to compute elements as they are needed HOT 4
- Error in hull HOT 3
- Inconsistent broken projection of a 4 - segment beach ball HOT 3
- Voronoi where each site is a segment instead of a point.
- Bounding box support for geoVoronoi HOT 4
- Unexpected Singularities in Projection HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-geo-voronoi.