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

Reproject keeps straight lines straight regardless of destination CRS #154

Open
astrojuanlu opened this issue Oct 2, 2018 · 0 comments
Open

Comments

@astrojuanlu
Copy link
Contributor

Reprojecting a straight line (or a rectangle) to a different projection will almost always bend the line into a curve. However, GeoVector.reproject does not have this notion:

In [3]: ANTIMERIDIAN = tl.GeoVector.line(((180, -89.999), (180, 89.999)), WGS84_CRS)

In [4]: new_crs = CRS({'units': 'm', 'proj': 'aeqd', 'ellps': 'WGS84', 'datum': 'WGS84', 'lat_0': 70.0, 'lon_0': 25.0})

In [5]: print(ANTIMERIDIAN.reproject(azeq_p0)._shape)
LINESTRING (383.4218956436899 -17771047.68159337, 48.17610439830184 2233086.230624789)

screenshot from 2018-10-02 16-45-29

In this particular case, it's only reprojecting the two end points, therefore producing the wrong result when plotting. On the contrary, Cartopy knows how to do it properly:

https://gist.github.com/Juanlu001/a01e396e2364274a4a50af61eb15f6ce

I think we would need some "resolution" parameter (like Shapely buffer) that inserts intermediate points in straight lines and reprojects each of those to produce a proper curve.

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

No branches or pull requests

1 participant