EarthPy: Python Package for Plotting and Working with Spatial Data

Mark Altaweel


A Python language spatial package, called EarthPy, has been released for free download for spatial analysts and scientists interested in conducting various forms of analyses without necessarily having a lot of background knowledge on Python or spatial analysis.

EarthPy was initially created by and for Earth system science with a heavy emphasis on raster data. However, the tool has now also incorporated vector-based and spatial methods that allow it to be extended into other application areas.

Increasingly, users want to plot and execute common GIS tasks in open source software that can also be decoupled with given tools so that it can be applied across other tools, sometimes tools that have no or limited spatial functionality. This allows researchers to more easily leverage and create their own applications, while users may not want to be burdened with having to learn yet another toolkit or language.

One tool that can allow you to do this, while giving you a large range of spatial functionality for raster and vector data, is EarthPy. The tool pitches itself as a plotting and data manipulation package for spatial data. Common functions include: stacking and cropping raster bands from data, working with masks to remove or manipulate pixel data, plotting colors and providing color combinations, including for different bands in imagery, create discrete legends, calculate vegetation indices and other common remote sensing calculations, hill shading and digital elevation modeling methods, clipping for points, line and polygons, and other related functions.

While these functions can be found in many common GIS tools, the portability and the fact they can be coupled with other functionality enables this to be useful for many researchers. The tool builds on GeoPandas, used for vector data, and Rasterio, commonly used for raster data.

The tool can be downloaded and installed using installation tools such as Conda.[1]  The developers have focused on making the tool easy to use in exploring raster and vector data, with a variety of applications built in, but developers and contributors are welcome to add functionality to the toolkit.[2]

Examples of using EarthPy to work with GIS data. Source: EarthPy Gallery
Examples of using EarthPy to work with GIS data. Source: EarthPy Vignette Gallery

Many researchers also see the future of geospatial sciences increasingly tied to machine learning and deep learning techniques, particularly those that apply neural network approaches to spatial data.

In the coming months or in the near future, EarthPy should expand its functionality in this area, offering potential for the tool to be applied in machine learning geospatial techniques such as convolutional neural network (CNNs) and random forest techniques.[3]

Applying a fuller range of functionality is the likely direction of EarthPy, including expanding its functionality in vector data applications. For instance, tools dealing with hydrology, least cost pathways, viewshed analyses are just some of the areas further expansion is possible in relation to Earth systems and environmental science areas but also applicable for other disciplines.

Another possibility is further incorporation of Python-based tools, and even R-based tools, into the package to help expand functionality, as the toolkit has already incorporated some popular packages and has been inspired by them.

Users can keep up to date with information and examples in applying EarthPy by going to their main website.[4]

Increasingly, spatial tools and technologies are used along with other applications. Researchers need flexibility to integrate libraries and tools as they need them when they create their own applications or if they want to carry out complex analyses without having to spend too much time learning the mechanics of operations.

EarthPy offers this potential to users. It is still a young tool and has only recently been released. One can expect more from it in the years to come, as it seems to have an active user group. The tool is also welcoming other developers and contributors, which could help expand its reach and application capabilities.


[1]    For more on downloading EarthPy, including summary on the application and functionality, see:

[2]    For more on functions of EarthPy, see:  Wasser L, Joseph M, McGlinchy J, et al. (2019) EarthPy: A Python package that makes it easier to explore and plot raster and vector data using open source Python tools. Journal of Open Source Software 4(43): 1886. DOI: 10.21105/joss.01886.

[3]  For more on future possibilities, including directionality of development, see: Morra G (2018) The Future. In: Pythonic Geodynamics. Cham: Springer International Publishing, pp. 209–216. DOI: 10.1007/978-3-319-55682-6_13.

[4]    To access information and examples of EarthPy, see:


Photo of author
About the author
Mark Altaweel
Mark Altaweel is a Reader in Near Eastern Archaeology at the Institute of Archaeology, University College London, having held previous appointments and joint appointments at the University of Chicago, University of Alaska, and Argonne National Laboratory. Mark has an undergraduate degree in Anthropology and Masters and PhD degrees from the University of Chicago’s Department of Near Eastern Languages and Civilizations.

Free weekly newsletter

Fill out your e-mail address to receive our newsletter!