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

Fix the antemeridian seam artifact #207

Open
mwichary opened this issue Dec 4, 2013 · 4 comments
Open

Fix the antemeridian seam artifact #207

mwichary opened this issue Dec 4, 2013 · 4 comments
Labels

Comments

@mwichary
Copy link
Contributor

mwichary commented Dec 4, 2013

An issue for Russia and possibly Oceania and The World.

This should be one contiguous object:
screen shot 2013-12-03 at 11 53 25 pm

@specious
Copy link
Collaborator

I haven't checked the shape files to see if the shapes are disjointed or not, but perhaps there's a possibility that the tool that was used to create the shapes was designed to apply strict ESPG:4326 constraints to the longitude and automatically split them.

We need to be able to wrap around to solve the problem of continuity.

@specious specious changed the title Fix the antemeridian cross line. Fix the antemeridian seam artifact Aug 2, 2022
@specious
Copy link
Collaborator

specious commented Aug 2, 2022

The 180th meridian seam is a known issue in standard cartography.

The file in question is:

https://github.com/codeforgermany/click_that_hood/blob/cceb9ea1/public/data/russia.geojson

It's the polygon titled "Чукотский автономный округ" (otherwise known as Chukotka, the northeasternmost region of Russia).

Using some jq wizardry to remove all of the other features in the geojson, leaving just Chukotka:

cat public/data/russia.geojson | jq '.features |= map(select(.properties.name == "Чукотский автономный округ"))'

The feature is of type "MultiPolygon" due to the islands. Deleting all the smaller subpolygons (very easy in vim with da[), we have two large pieces left:

chukotka-edited.geojson.txt

Put this into geojson.io to see that the shape in question is simply broken into two pieces along the 180th meridian in the data file itself.

@specious
Copy link
Collaborator

specious commented Aug 3, 2022

Although the official recommendation from the RFC on the geojson format is to divide shapes so they don't cross the antimeridian to ensure general compatibility with software that works with geojson, in this particular use case it probably makes sense to consolidate the two pieces into one and let the longitude coordinate cross the meridian.

My guess is the renderer should have no issue drawing it.

@epaulson
Copy link
Collaborator

epaulson commented Aug 3, 2022

I think it'd be nice to try to combine it and see what happens - but in my (admittedly not-very-smart-about-GIS-stuff), d3 deals with the antimeridian different than other packages - d3's approach is probably better, but I'm not smart enough to get it right. I had a heck of a time in #323 (and #330) getting all of the viewport calculations right AND keeping the antimeridian handling correct, and I'm not sure I got it always right. If you resize your window so it's too small with maps that push too far north, the distortion gets really, really bad.

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

No branches or pull requests

3 participants