matplotlib / basemap

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

GEOS Install fails #513

Closed mknaranja closed 2 years ago

mknaranja commented 3 years ago

The GEOS installation may fail on some newer systems, maybe you can provide the workaround of https://gis.stackexchange.com/questions/289409/error-building-geos-on-ubuntu-18-04 in the readme.

molinav commented 2 years ago

If it is ok for you I would close the issue. Former basemap versions were being compiled against a vendored copy of GEOS 3.3.3 (very old, as you said). Since basemap version 1.3.0, the vendored copy is removed from the repository and basemap can be compiled actually against any newer version of GEOS as desired (at least it seems to work until GEOS 3.8.x).

In particular, for the precompiled binary wheels that I am uploading to PyPI, I am using GEOS 3.5.1 and it works without the need of any special flags. I use this GEOS version because it is the only one I could make compile on all the systems I wanted to target (Windows and GNU/Linux, x86 and x64), but locally I also know that GEOS 3.6.5 can be compiled on GNU/Linux without problems (this is the last version of GEOS that does not require C++11 features).

Since version 1.3.0, the basemap source code also includes a GeosLibrary class in the utils folder that acts as a wrapper to build and install GEOS easily under Windows or GNU/Linux.

molinav commented 2 years ago

Just to make my previous comment clearer. Since version 1.3.0, you can install basemap directly from PyPI using pip:

python -m pip install basemap

and therefore all the compilation headaches that were common with basemap are now gone because the PyPI wheels bundle everything already compiled. basemap automatically installs the basemap-data package, which contains the crude-, low- and intermediate-resolution datasets. In case you need the high- or full-resolution datasets, you need to install them manually:

python -m pip install basemap-data-hires
mknaranja commented 2 years ago

I haven't used it for some time but if you got notice of the problem and tested it accordingly, I think it's okay if you close it :)

molinav commented 2 years ago

@mknaranja Perfect, thanks!