d3 / d3-geo

Geographic projections, spherical shapes and spherical trigonometry.
https://d3js.org/d3-geo
Other
1.03k stars 161 forks source link

D3 uses GeoJSON to represent geographic features in JavaScript #265

Closed gonzobard777 closed 2 years ago

gonzobard777 commented 2 years ago

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 commented 2 years ago

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).

gonzobard777 commented 2 years ago

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