Skip to content
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 uses GeoJSON to represent geographic features in JavaScript #265

Closed
gonzobard777 opened this issue Sep 1, 2022 · 2 comments
Closed

Comments

@gonzobard777
Copy link

In README it is written:

D3 uses GeoJSON to represent geographic features in JavaScript

I asked the question: Geographic or Geodetic
I concluded that the coordinates of a point on a sphere should be passed to the D3 projection.

On the other hand, GeoJSON uses WGS 84 (World Geodetic System 1984), and in it, in turn, the ellipsoid is taken as the basis.

Therefore, it is not clear how D3 uses GeoJSON to represent geographical objects in JavaScript, if the projections of D3 expect points on a sphere, and GeoJSON consists of points on an ellipsoid.
Can you explain it?

@mbostock
Copy link
Member

mbostock commented Sep 1, 2022

GeoJSON is not required to use any particular coordinate system. D3 geographic projections assume spherical geometry (and in other cases, parts of D3 assume planar geometry that is already projected). The difference between spherical and geodetic coordinates is typically irrelevant for thematic mapping (and if it’s not for you, you probably shouldn’t use D3’s geographic projections).

@mbostock mbostock closed this as completed Sep 1, 2022
@gonzobard777
Copy link
Author

GeoJSON is not required to use any particular coordinate system.

According to the specification, this is not the case:
https://www.rfc-editor.org/rfc/rfc7946#section-4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants