developmentseed / dirty-reprojectors

Make quick and dirty projections to use in your web maps instead of Web Mercator
https://www.developmentseed.org/dirty-reprojectors-app/
MIT License
120 stars 10 forks source link

Use `d3-geo-projection` #5

Closed anandthakker closed 8 years ago

anandthakker commented 8 years ago

I noticed in a tweet by mbostock this weekend that d3-geo-projection actually ships with command line tools which might obviate some of the work that's happening in reproject-geojson. I think it would make sense to refactor to use that, and keep this repository very specifically focused on the trickery required to get this to work with Mapbox Studio / GL

dereklieu commented 8 years ago

Yeah, I basically discovered that around the same time and am working on that in this more projections branch.

One issue I ran into early on is that all the projections come of the box with a flipped Y axis. I'm betting this is to make it plug-and-play with the D3/SVG workflow, which flips the Y axis as well. I made forks of d3-geo and d3-geo-projection to correct this, and it's working for everything except the all-important Albers US projection, which shows Hawai'i and Alaska right, but the continental 48 upside-down. This was as far as I got last weekend.

screen shot 2016-11-21 at 7 25 21 pm

@anandthakker if you have a cycle and want to take a look at the current state of things, that branch is the place to start. My fork of d3-geo, where the projection calculation is happening, is here. I almost didn't have to fork d3-geo-projection, except it includes d3-geo as a dep.

dereklieu commented 8 years ago

A cleaner option could be to leave d3-geo alone and flip the projected data ourselves, or go back to using the script you already wrote. The d3-geo-projection CL tool is a bit cleaner on some of the weirder projections though.

anandthakker commented 8 years ago

Ah, cool. I'll check out that branch -- maybe there's a nice in-between solution; I think it would be beneficial to avoid forking the d3-* stuff if possible.

On Mon, Nov 21, 2016 at 7:31 PM Derek Lieu notifications@github.com wrote:

A cleaner option could be to leave d3-geo alone and flip the projected data ourselves, or go back to using the script you already wrote. The d3-geo-projection CL tool is a bit cleaner on some of the weirder projections though.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/developmentseed/dirty-reprojectors/issues/5#issuecomment-262111710, or mute the thread https://github.com/notifications/unsubscribe-auth/AEvmR-0dMhOToHLNSEzzr6arOq69nuduks5rAjfZgaJpZM4Kxk_j .

anandthakker commented 8 years ago

See #6