matplotlib / basemap

Plot on map projections (with coastlines and political boundaries) using matplotlib
MIT License
772 stars 390 forks source link

Add caching to arcgisimage #562

Closed JoepdeJong closed 1 year ago

JoepdeJong commented 1 year ago

arcgisimage is slow due to network communication, especially when you are working with high-resolution plots of the same region. This commit adds a cachedir to the arcgisimage function, to prevent downloading the same image multiple times.

molinav commented 1 year ago

Thanks for the contribution, @JoepdeJong! Since this pull request adds a new feature, I moved the target branch from master to develop, so that this new argument in Basemap.arcgisimage will appear in the next minor release of basemap (1.4.0).

Currently, I am putting most of my effort in the basemap 1.3.x series, with patches that were required since long time ago to make basemap a bit more stable, so I still do not have a planned date to prepare the release 1.4.0. In the meantime, you can install basemap directly from the develop branch with:

python -m pip install git+https://github.com/matplotlib/basemap#subdirectory=packages/basemap

Note that in this case you will need to have a C compiler for the _geoslib module build, and define GEOS_DIR in case that you do not have GEOS in some of the common installation paths.

guidocioni commented 11 months ago

Hey @molinav, as I see this PR is already closed, I have few questions and comments:

molinav commented 11 months ago

Hi @guidocioni!

This PR was merged into the develop branch, so it is targeting the next minor release (1.4.0). I wanted to finalise 1.4.0 long ago but I just did not find enough spare time.

The patch releases (like 1.3.8) are branched directly from master (the latest stable tag) to correct things that are not working as supposed. When the fixes are done, I merge back to master to create a new tag and the corrections are also merged to develop so that they are also included in the next minor release.

If you see that something like you said is not working, feel always free to create a new PR into develop. One of my goals for 1.4.0 was to start having a basic test suite running, to have reports on the code coverage and prevent easy-to-detect bugs as you found.