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

geoAzimuthalEqualArea not rendering straight lines #268

Closed
fromdusttilldawn opened this issue Nov 18, 2022 · 2 comments
Closed

geoAzimuthalEqualArea not rendering straight lines #268

fromdusttilldawn opened this issue Nov 18, 2022 · 2 comments

Comments

@fromdusttilldawn
Copy link

fromdusttilldawn commented Nov 18, 2022

Hi

I made a map of Europe, where Russia and Turkey are still visible, but only to a certain degree. Using mapshaper I clipped the rest of those countries. The map looks like this when applying the command -proj laea (yes, I'm aware that Norway and Finland are clipped too much):

mapshaper

Now I'd like to render that map using the geoAzimuthalEqualArea projection from d3-geo. I use the projection like this (no extra settings):

geoAzimuthalEqualArea()

geoAzimuthalEqualArea

Why are the features on top and the right curved like that? Am I missing something?

Thanks already for any inputs or tips.

@Fil
Copy link
Member

Fil commented Nov 18, 2022

This works as expected. Mapshaper has clipped the shapes in planar coordinates, and connects consecutive points on the edge with no intermediate points. d3-geo then does great circle interpolation between those points (so parallels become “curves”), and furthermore along a projection that doesn't convert meridians to straight lines (so meridians also become “curves”).

Instead of mapshaper, you could try to use d3.geoProject to do the projection + rectangular clipping. See https://observablehq.com/@recifs/project-and-clip for an example.

See also https://observablehq.com/@d3/spherical-clipping

@Fil Fil closed this as completed Nov 18, 2022
@fromdusttilldawn
Copy link
Author

I'll gladly have a look at those Observables. Thank you so much!

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