-
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
ValueError: 'vertices' must be a 2D list or array with shape Nx2 #512
Comments
I have a similar problem. I think this might be because your domain does not intersect any coastlines? I have this reproducer: # fails
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
b = Basemap(projection="cea", llcrnrlon=267.5, urcrnrlon=283.995, llcrnrlat=41.35, urcrnrlat=51, resolution="l")
b.drawcoastlines()
plt.show() Note: The above fails in basemap 1.2.1 (matplotlib 3.5.1) and works in basemap 1.1.0 (matplotlib 2.1.1), regression somewhere... But if I extend a bit to have an intersection with the ocean coastlines (in this case to the Hudson Bay) it works # works
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
b = Basemap(projection="cea", llcrnrlon=267.5, urcrnrlon=283.995, llcrnrlat=41.35, urcrnrlat=51.8, resolution="l")
b.drawcoastlines()
plt.show() @jswhit I know we are not supposed to bug you with this project, but maybe you have a workaround for this... |
This is most likely due to a change I made to address a problem with an
update in proj4. IIRC, the projection parameters were getting cast to
float32, thereby reducing the accuracy of the projection. Most likely, I
removed the casting, so maybe an integer passing though is causing issues?
…On Thu, Mar 31, 2022 at 12:02 PM Huziy Oleksandr ***@***.***> wrote:
I have a similar problem. I think this might be because your domain does
not intersect any coastlines? I have this reproducer:
# fails from mpl_toolkits.basemap import Basemapb = Basemap(projection="cea", llcrnrlon=267.5, urcrnrlon=283.995, llcrnrlat=41.35, urcrnrlat=51, resolution="l") b.drawcoastlines()
*Note*: The above fails in basemap 1.2.1 and works in basemap 1.1.0,
regression somewhere...
But if I extend a bit to have an intersection with the ocean coastlines
(in this case to the Hudson Bay) it works
# works from mpl_toolkits.basemap import Basemapb = Basemap(projection="cea", llcrnrlon=267.5, urcrnrlon=283.995, llcrnrlat=41.35, urcrnrlat=51.8, resolution="l") b.drawcoastlines()
@jswhit <https://github.com/jswhit> I know we are not supposed to bug you
with this project, but maybe you have a workaround for this...
—
Reply to this email directly, view it on GitHub
<#512 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHF6GGGE47N3R2IDWZAX3VCXECRANCNFSM4YPWKFLQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@guziy With the latest
For this example I am using the |
@molinav Could you please try to create the following conda environment: conda create -n py39 python=3.9 basemap ipython
conda activate py39 Here are the versions
Here is the info for the basemap=1.2.2 conda package:
|
This pull request fixes drawcoastlines issue #512 by discarding empty coastline segments.
@guziy The From other issue (#522 (comment)) it seems that we are blocked at the moment to GEOS < 3.9. |
|
The conda recipe is available in a separate repo: There were a couple of external attempts to update the recipe but they did not succeed or were closed before finishing: Unfortunately, I could not still find time to learn about conda recipes to provide my own update there. |
@guziy This issue and your fix were included in The latest |
I'm using Python 3.8.5
Matplotlib version 3.1.2
and basemap-1.2.2+dev
I'm running something like:
and then I got this:
I checked everything, but I'm used to run this on basemap 1.0.7 and everything was ok.
And when I run without m.drawcoastlines(), there is no problem.
What can I do to run it?
The text was updated successfully, but these errors were encountered: