-
Notifications
You must be signed in to change notification settings - Fork 364
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
Stuck while loading 10m oceans #403
Comments
What version of cartopy are you on? I know we did some work on this a while back and thought it may have been fixed. |
P.S. Confirmed on master at 0a0b548. |
Experienced on both master and 0.10. |
In fact, it's not really stuck, it's just extremely slow. |
Ah, that is useful to know, thanks @BertrandBordage. I suspect there is a thresholding issue somewhere down the line and the linestring is being interpolated to a crazy resolution. Hopefully I will get a chance to look at this next week some time (with a prevailing wind). |
Excellent! Thanks :) |
I've done some digging this afternoon as to the cause of the painful performance. I ended up giving up on the python shapefile library - it was just too slow for global use. I suspect that we are going to need to make use of Fiona if it is available, and fall back to pyshp if it is not. However, that was only half of the problem. I was expecting the geometry transform to be particularly slow, but it turned out to be the conversion from Path -> GEOS geometry which is really slow due to a high number of containment tests (https://github.com/SciTools/cartopy/blob/master/lib/cartopy/mpl/patch.py#L203). I've been playing with wrapping a library (clipper) which will allow us to accurately convert from the potentially non-simple Path geometry to a simple GEOS like geometry efficiently - this might be the best solution to the performance bottleneck. Hopefully I can put some more time on this over the next week or so. |
This appears fixed by #1000, once it's released, and provided you have fiona installed. |
When you try to draw high-resolution oceans, cartopy gets stuck in an infinite loop. I redownloaded the .shp file in case it was broken, but nothing changes.
Minimal example:
The text was updated successfully, but these errors were encountered: