Getting the most out of GeoPandas 1.0

After 10 years since the first release, GeoPandas reached version 1.0. This workshop will showcase how to get the most out of the recent enhancements and develop a code ready for 2024 and beyond. Workshop resources are available on Github. Annotation GeoPandas is one of the core components of the GeoPython ecosystem, providing the critical infrastructure to work with vector spatial data, usually reserved for the context of GIS, in Python. Although central to many applications and supporting many users, GeoPandas was technically not considered stable (even though it was practically for a long time). With GeoPandas 1.0, this is no longer the case, and the project has reached maturity and stability we can build upon in years to come. ...

May 27, 2024 · 2 min

GeoPandas 1.0 is coming. What will change?

The GeoPandas team is racing towards the 1.0 release, nearly 10 years after 0.1 made it to PyPI. As with any major release, it brings some changes. This post highlights those I feel are the most important and invites you to test the 1.0.0-alpha1 and later rc versions before we let the stable version fly to the world. Please test! As of today, GeoPandas 1.0 is out as a pre-release 1.0.0-alpha1. If you read it during April or May 2024, please install the pre-release and test your code against it. If anything looks odd, please let us know! ...

April 13, 2024 · 4 min

A note on Spatial Data Science across Languages, vol.1

I am sitting on a train back to Prague after two days of discussing tooling for spatial data science available in the Python, R and Julia ecosystems, with occasional excursions to the worlds of Rust, JavaScript or ESRI. I am coming back from the Spatial Data Science across Languages (SDSL) workshop and I’d like to share a few thoughts1 while they’re fresh. Different maturity of ecosystems As a Python developer, I must admit that what the R-Spatial community managed to create is impressive and is in some aspects further that where we are. The most notable is the support of spherical geometries. Where geopandas warns that a computation of area or a distance in geographic (longitude, latitude) coordinates is incorrect (more on this behavior below), {sf} returns a correct value. The same support is on the geopandas roadmap but it will not be done by tomorrow.2 Same could be said about the extent of support of spatial statistics but that is the same as with any statistics. R was built for it. ...

September 20, 2023 · 4 min

Writing an efficient code for GeoPandas and Shapely in 2023

With the release of Shapely 2.0, the GeoPandas-based code that have been optimised years ago may no longer provide the best performance. The workshop organised during the GeoPython 2023 together with Joris Van den Bossche showed how to change that and write efficient and convenient GeoPandas code that uses the benefits of the latest developments in the Python geospatial ecosystem. Workshop resources are available on Github. Annotation The Python geospatial ecosystem is constantly evolving, rushing towards better usability, new features, fewer bugs and increasing performance. As a result, the code that might have been optimised a few years ago may not provide the ideal experience today. Such a shift has recently happened in the GeoPandas world. After years of development, Shapely 2.0, a major refactoring of the famous Python wrapper of GEOS, came out in December 2022, switching the way how we think about vector geometry handling. From former scalar geometries requiring for-loops to go through, we can now interact with arrays of them in a performant vectorised manner. These developments directly affect how GeoPandas shall be used, which are the good practices and which are no longer up to speed. ...

May 2, 2023 · 2 min

Fixing missing geometries in a polygonized network

If you ever wanted to polygonize (i.e. create polygons formed from the linework of a set of geometries, as per shapely’s definition) something like a street network with shapely, you may have noticed missing geometries in the result, like in the case of Vienna below. I had the same issue, and this is a note to myself with a solution. The result of shapely.polygonize with gaps that should not be there. ...

January 23, 2023 · 2 min

Introduction to GeoPandas and its Python ecosystem

A talk from the OpenGeoHub Summer School 2022. Workshop materials Recording The ecosystem of packages for spatial data handling and analysis in Python is extensive and covers both vector and raster analytics from small to large distributed data. This talk covers only a small part, focusing on vector data processing with GeoPandas at its core. First, it covers what GeoPandas is and how it relates to other packages and combines them into a user-friendly API. Then it looks at what GeoPandas enables with a light introduction to PySAL Python Spatial Analysis Library for spatial statistics and modelling. The final part touches on the scalability issue and introduces how to handle parallel computation and big data using GeoPandas and Dask. All of that is illustrated by hands-on tasks on real-world data. ...

October 20, 2022 · 1 min

How to create a vector-based web map hosted on GitHub

This is the map we have created for the Urban Grammar AI project. It is created using open source software stack and hosted on GitHub, for free. This post will walk you through the whole process of generation of the map, step by step, so you can create your own. It is a bit longer than usual, so a quick outline for better orientation: By the end of this tutorial, you will be able to take your vector data and turn them into a fully-fledged vector map hosted on GitHub with no cost involved, for everyone to enjoy. ...

September 29, 2022 · 14 min

Understanding the structure of cities through the lens of data

The workshop organised together with James D. Gaboardi during the Spatial Data Science Symposium 2022 is now available online. See the recording below and access the workshop material on Github from which you can even run the code online, in your browser. Annotation Martin & James will walk you through the fundamentals of analysis of the structure of cities. You will learn what can be measured, how to do that in Python, and how to use those numbers to capture the patterns that make up cities. Using a real-life example, you will learn every step of the method, from data retrieval to detection of individual patterns.

September 29, 2022 · 1 min

Scaling up vector analysis with Dask-GeoPandas

The workshop organised during the GeoPython 2022 together with Joris Van den Bossche introduces the Dask-GeoPandas library and walks you through its key components, allowing you to take a GeoPandas workflow and run it in parallel, out-of-core and even distributed on a remote cluster. Workshop resources are available on Github. Annotation The geospatial Python ecosystem provides a nice set of tools for working with vector data, including Shapely for geometry operations and GeoPandas to work with tabular data (and many other packages for IO, visualization, domain specific processing, …). One of the limitations of those core tools is a sub-optimal performance and limited scaling possibilities. ...

June 22, 2022 · 2 min

Introducing Dask-GeoPandas for scalable spatial analysis in Python

Using Python for data science is usually a great experience, but if you’ve ever worked with pandas or GeoPandas, you may have noticed that they use only a single core of your processor. Especially on larger machines, that is a bit of a sad situation. Developers came up with many solutions to scale pandas, but the one that seems to take the lead is Dask. Dask (specifically dask.dataframe as Dask can do much more) creates a partitioned data frame, where each partition is a single pandas.DataFrame. Each of them can be then processed in parallel and combined when necessary. On top of that, the whole pipeline can be scaled to a cluster of machines and can deal with out-of-core computation, i.e. with datasets that do not fit the memory. ...

March 31, 2022 · 3 min