d3 / d3-geo

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

d3.geoGraticule should have a configurable latitude precision. #95

Open mbostock opened 7 years ago

mbostock commented 7 years ago

Currently you can configure the precision for longitude but not latitude. The latter is fixed at 90°:

x = graticuleX(y0, y1, 90);
y = graticuleY(x0, x1, precision);
X = graticuleX(Y0, Y1, 90);
Y = graticuleY(X0, X1, precision);

For d3-geo this feature isn’t needed, but for projection systems that don’t support adaptive sampling, and particularly since we don’t have a d3.geoSegmentize yet (d3/d3-geo-projection#75), it can be useful to allow the latitude precision to be configured.

Fil commented 5 years ago

This also impacts d3.geoGilbert.

geogilbert graticule

Fixed by using using precision = 1 in d3-geo/src/graticule.

geogilbert graticule 1
jrus commented 3 years ago

This looks like a bug in the way geoGilbert handles resampling (i.e. it breaks resampling), rather than a problem with the graticule per se.