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
d3.geo.{centroid,area} #941
Comments
We should use a spherical polygon area weighting though, otherwise this will be wrong. This should also comply with our interpretation of polygon inside/outside. |
Polygons are temporarily treated as lines while I work on adding area weighting. See #941.
Do we want to return area in (°)² for consistency with our use of degrees elsewhere? Aside from coordinates being in degrees, we also have d3.geo.{circle,greatArc,graticule}.precision, d3.geo.graticule.extent and d3.geo.circle.angle. If so, we might also make a backwards-incompatible change to d3.geo.greatArc.distance to return degrees, too. Alternatively, we could simply return steradians and say that this is consistent with d3.geo.greatArc.distance, and simpler to use when converting to real-world units by multiplying by Earth's radius² or radius. |
I would go with steradians. |
Added in 3.0. |
This would be useful for computing the lat-lon centroid:
Jason points out that we should probably expose d3.geo.area as well, both using spherical coordinates.
The text was updated successfully, but these errors were encountered: