-
Notifications
You must be signed in to change notification settings - Fork 394
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
readshapefile() inconsistencies #410
Comments
The problem is that it is difficult to unwrap the coordinates for polygons
because it depends upon which way across the fold the polygon is going.
This is one of the reasons why basemap is being replaced by cartopy, which
handles situations like these better.
…On Wed, Jun 13, 2018 at 1:33 PM, avipersin ***@***.***> wrote:
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
map = Basemap(projection='robin', lat_0=0, lon_0=100)
map.readshapefile('./Paleo_Sturtian_750Ma', 'Paleo_Sturtian_750Mm')
plt.show()
Using the "robin" projection:
- lon_0=0 everything works fine
- lon_0 = anything else; causes wrap around problems. Horizontal lines
through the plot.
[image: robin]
<https://user-images.githubusercontent.com/8727319/41367816-224d3206-6f0e-11e8-9a17-7b994f972bf5.png>
Using the "cyl" projection:
- lon_0=0 everything works fine.
- lon_0 = anything else; No lines through the plot but doesn't plot
the right side of the shape file.
[image: cyl]
<https://user-images.githubusercontent.com/8727319/41367795-12d6974a-6f0e-11e8-8d1b-35612f363983.png>
Is it possible to change the center longitude while plotting a shapefile?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#410>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARy-CsIyx29NRy0OlEjd-nVzmeMDMvCks5t8UzTgaJpZM4UmoLC>
.
|
Is there a workaround or a continental outline format supported by basemap that doesn't have this issue? How does drawcoastlines() avoid this problem entirely? |
to be honest, I am actually not certain that it does properly avoid the situation. We do have a shiftdata function, but it is finicky at best and can produce wrong results. I don't know for sure if drawcoastlines() uses it or not. |
In case others stumble upon this... The readshapefile() function is glitchy. There are inconsistencies when using different projections as well as different center longitude and latitude points. In order to get this working I've had to convert my original shapefiles to one that the readshapefile() function can properly understand. The code to convert the shapefiles:
|
The shapefile I'm using can be downloaded from: my github.
Using the "robin" projection:
Using the "cyl" projection:
Is it possible to change the center longitude while plotting a shapefile?
The text was updated successfully, but these errors were encountered: