»Shapely 2.0: an improved foundation for GeoPandas and the Python geospatial ecosystem«
2020-09-22, 11:00–11:30, Room 1
Shapely, the python package providing an easy Python interface for working with geometries, is getting an overhaul. Improved bindings to GEOS using fast, vectorized functions will help to substantially improve the performance of GeoPandas.
Shapely provides a nice, pythonic interface to work with geometries (points, lines, polygons) and to perform operations on those geometries. Shapely is, amongst others, further used by GeoPandas, which extends the Pandas data analysis library to work with geometry data. This way, it provides easy-to-use functionality to work with geometries and their attributes in tabular form (similar as PostGIS). Shapely is a Python interface to the GEOS C++ library, an implementation of the OpenGIS Simple Features (geometries) and related spatial predicates and operations. GEOS is one of the foundational libraries of the open source geospatial ecosystem, and provides the spatial functionality of many projects such as QGIS, PostGIS, and is wrapped in many languages such as the spatial R packages sf, and, thus also by Shapely in Python.
Currently, Shapely only provides an interface for scalar geometry objects. This means that all operations in GeoPandas are implemented by looping over those scalar geometries in Python, which is one of the reasons that GeoPandas can have sub-optimal performance. Over the last years, effort has been put in improving the performance through vectorized interfaces to GEOS. This has lead to a new package, PyGEOS, with the aim to provide a more direct and numpy-based interface to GEOS, which can provide a significant performance improvement when working with large arrays of geometries. To avoid a split in the community, the developments of PyGEOS are being contributed back to Shapely, in the form of a proposal for a "Shapely 2.0" (https://github.com/shapely/shapely-rfc/pull/1/). This is currently in the works and should enable a more scalable foundation for working with geometries in Python.
This presentation will give an overview of the GEOS library, the improvements developed in PyGEOS and coming to Shapely 2.0, and show how this will improve the geometry processing in Python.