-
Notifications
You must be signed in to change notification settings - Fork 158
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.geoBounds gives incorrect bounds for one of the polygons in world-atlas countries50, Fiji) #243
Comments
While we are at it, I haven’t investigated closely, but countries50’s Antarctica gets a bounding box that does not go all the way to the south pole. Graphically, both of these issues result in: Edit: uh.... Ring 0 of the polygon: {
var antarctica = JSON.parse(JSON.stringify(countries50.features[239].geometry));
antarctica.coordinates = antarctica.coordinates.slice(2, 3); // Polygon 2 of the MultiPolygon
antarctica.coordinates[0] = antarctica.coordinates[0].slice(0,1); // Ring 0 of the Polygon
return d3.geoBounds(antarctica);
} -> Ring 1 of the polygon: {
var antarctica = JSON.parse(JSON.stringify(countries50.features[239].geometry));
antarctica.coordinates = antarctica.coordinates.slice(2, 3); // Polygon 2 of the MultiPolygon
antarctica.coordinates[0] = antarctica.coordinates[0].slice(1,2); // Ring 1 of the Polygon
return d3.geoBounds(antarctica);
} -> Rings 0 and 1 together: {
var antarctica = JSON.parse(JSON.stringify(countries50.features[239].geometry));
antarctica.coordinates = antarctica.coordinates.slice(2, 3); // Polygon 2 of the MultiPolygon
antarctica.coordinates[0] = antarctica.coordinates[0]; // Both rings of the Polygon
return d3.geoBounds(antarctica);
} -> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I do:
The result is
[[-180,-16.541749856561054],[180,-16.43238163897263]]
I would instead expect the left longitude to be 179.something and the right longitude to be -179.something.
After conversion from topojson to geojson, the polygon in question has coordinates:
The text was updated successfully, but these errors were encountered: