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

compatibility of geoRectangularPolyconicRaw with geoInterrupt #178

Open
mxfh opened this issue Sep 12, 2019 · 3 comments
Open

compatibility of geoRectangularPolyconicRaw with geoInterrupt #178

mxfh opened this issue Sep 12, 2019 · 3 comments
Assignees

Comments

@mxfh
Copy link

mxfh commented Sep 12, 2019

passing geoRectangularPolyconicRaw with no phi0 to geoInterrupt returns only NaNs and
with phi0 > 0 the lobes are becoming increasingly offset away from the center.
see behavior here. Is this expected or should that be compensated and defaulted in the case of unset phi0?
https://observablehq.com/@mxfh/compatibility-of-georectangularpolyconicraw-with-geoin

@Fil
Copy link
Member

Fil commented Sep 12, 2019

geoRectangularPolyconicRaw with no phi0 returns NaNs because geoRectangularPolyconicRaw is a function (of phi0) that returns a raw projection. So that's expected.

The second part of your comment seems indeed to point to something missing in the way we compute the shifting of the lobes, by assuming that the equator is of constant scale (if I'm reading correctly
https://github.com/d3/d3-geo-projection/blob/master/src/interrupted/index.js#L74 )

(As phi0 is the "true scale" parallel of that projection (expressed in radians), when you set it to 0 you effectively get a true scale equator which explains why the lobes are correctly contiguous in this case.)

@Fil Fil self-assigned this Sep 12, 2019
@mxfh
Copy link
Author

mxfh commented Sep 12, 2019

I see that the lobe origin is scaled at the non-true scale for non-zero phi0, but most curious about why it seems to not effect lobe count = 2 ? Because the scaled lobe offset is cancelled out by the scale change within the lobe at equator?

This seems to affect all projections where the raw function is a function of a parallel/parallels or with a non-true scaled equator.

See Armadillo here:
compatibility-of-georectangularpolyconicraw-with-geoin

Fil added a commit that referenced this issue Sep 12, 2019
…tion (project) is linear wrt longitude; it's not always the case, so we have to add and substract each lobe's lengths, from the bottom-left of the triangle to the midpoint, then to the bottom-right.

addresses #178 but does not fix it completely: the inverse is missing, and tests are missing too.
@Fil
Copy link
Member

Fil commented Sep 12, 2019

I just commited a change that addresses the issue. It's not complete (no inverse, no tests…), but it's a start :)

You can test the build at https://observablehq.com/d/bde6f23d798d4f72 (it uses https://files-6p35z2y9v.now.sh/d3-geo-projection.js )

I've also removed the meaningless geoRectangularPolyconicRaw test.

See branch https://github.com/d3/d3-geo-projection/tree/issue178

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