matplotlib / basemap

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

Basemap on Windows #520

Closed peterkuma closed 2 years ago

peterkuma commented 2 years ago

Hi,

I have recently built a basemap Python wheel on Windows on Anaconda Python 3.8, compiled with Visual Studio 2019. There were a few issues which needed to be resolved first (re-cythonizing the pyx module and bundling of GEOS DLLs in the wheel). I wonder if you would be interested in merging those changes, and possibly providing a Python wheel for Windows through PyPI?

The repository with the commits is at peterkuma/basemap.

Kind regards,

Peter

WeatherGod commented 2 years ago

Peter,

Basemap -- for all intents and purposes -- is a dead project. While there are a few people that are supporting it for purposes internal to their organizations, there just has not been enough effort to truly keep it going. Please move on to using the Cartopy project instead. Thank you for your offer to contribute back your patch.

On Mon, Sep 13, 2021 at 6:56 AM Peter Kuma @.***> wrote:

Hi,

I have recently built a basemap Python wheel on Windows on Anaconda Python 3.8, compiled with Visual Studio 2019. There were a few issues which needed to be resolved first (re-cythonizing the pyx module and bundling of GEOS DLLs in the wheel). I wonder if you would be interested in merging those changes, and possibly providing a Python wheel for Windows through PyPI?

The repository with the commits is at peterkuma/basemap https://github.com/peterkuma/basemap.

Kind regards,

Peter

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/matplotlib/basemap/issues/520, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACHF6AJHVR6S3PS534WEMLUBXKGXANCNFSM5D5RGCAA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

peterkuma commented 2 years ago

Thank you for your quick response. I understand that the project is now discontinued. I have only asked because I am a maintainer of software which uses basemap (ccplot) and some users have asked for Windows support. However, I plan to migrate it to cartopy at some point in the future.

Generally, I think it is good if old software is kept operational even if new features are not added. But I understand that it can take a lot of time, considering that the Python environment keeps changing fast.

molinav commented 2 years ago

@peterkuma I recently finished the main refactoring of basemap into three separate packages (basemap, basemap-data and basemap-data-hires) here in the main matplotlib/basemap repo.

I could add GitHub Actions to create prebuilt wheel binaries for GNU/Linux (32 and 64 bit) that get deployed directly to PyPI: https://pypi.org/project/basemap/1.3.0b1/ https://pypi.org/project/basemap-data/1.3.0b1/ https://pypi.org/project/basemap-data-hires/1.3.0b1/

Windows wheels are on the way: I can create them in my personal laptop manually but the GitHub Actions are still pending. I added a GeosLibrary class in utils that makes the installation easier especially for Windows (also relying on CMake and MSVC, it seems you and I developed similar things in parallel here). GeosLibrary at the moment builds only for x64 on Windows but it should be easy to extend.

For MacOS I really do not have much idea on how to build the wheels and I do not have any computer with macOS available, so any help would be very appreciated.

peterkuma commented 2 years ago

The changes have made to support compiling on Windows (and macOS) were really quite simple changes to the setup.py script (you can see them in the repository linked above). On macOS, I have used MacPorts for the GEOS library, but it is of course not ideal to ask users to install MacPorts (or Homebrew) to install a Python package from a source distribution, and a wheel is preferable. I could perhaps help with getting a wheel built for macOS Intel. I don't have access to any M1 macOS. OSX-KVM is a really simple way of getting an Intel macOS VM running on Linux. I don't normally use Windows or macOS, so my experience with compiling stuff on those platforms is limited.

molinav commented 2 years ago

@peterkuma For your information, I could finally upload the stable release 1.3.0 of basemap to PyPI. This release includes a helper class to build GEOS on Windows (by means of nmake) or GNU/Linux (by means of cmake), and now PyPI also hosts precompiled wheels for both platforms with libgeos inside.

peterkuma commented 2 years ago

Thank you @molinav . I suppose I can close this issue now.