I am a data-scientist (an applied economist) and I have often to deal with data that includes spatial attributes.

I am hence interested in using spatial data, rather than producing spatial attributes.

Typical operations are attribute merging for vector data or pixel computations for raster data.

My colleagues use extensively R for these operations. My workflow is however in Python, and I am looking for a high-level python library that would allow me to keep a consistent workflow.

In particular I already managed to integrate data analysis with Python using the pandas library, and I wonder if there is a high level library that integrates the various GIS tools to provide a high-level unified interface. In all cases I am looking for script-based solutions, to work with Jupiter, rather than GUI programs like QGIS.

These are the libraries I have already evaluated and the reasons why they don't fit my needs:

  • GeoPandas This is the closest library to my needs, but it is still immature compared with R (e.g. it's not possible to set the legend position in the map, there is no extensive documentation for the API..) and only vector operations are supported (no rasters).
  • QGIS Python bynding (PyQGIS) Aside the dependence on user-specific Qgis installation path, the main problem is that it requires to adapt the script to consider GUI specific elements (like the concepts of application, canvas,..) that complicate pure scripting tasks.
  • Python/GDAL, Shapely, Matplotlib basemap toolkit, Fiona These are all relatively low-level libraries that do specific tasks that possibly would be used by a higher-level library.

closed as too broad by Mapperz Jul 8 '16 at 14:29


  • 1
    This question is still quite broad. Did you read the help as suggested? – Brad Nesom Jul 8 '16 at 8:26
  • Well, I have read the "help center" that basically explains how the moderation system works (it doesn't contain any more hint on what a good question is considered, compared to the message attached to the "put on hold" tag). Coming back to the question, I don't know how to make it more focused. Basically I am asking if there is an alternative in Python for R in the domain of its geographical capabilities. – Antonello Jul 8 '16 at 9:23
  • 1
    I think you'll get a better response here by defining what you are trying to do and researching/asking about it. Take a particular R workflow and and try to find "how do I do X in Python?" – Evil Genius Jul 8 '16 at 11:02
  • 1
    1. What is high level? 2. Which point of view rod the data scientist? 3. What exactly does the data scientist want to know? There is a help FAQ how to ask a good question. Ald there should only be one question contained in each post. – Brad Nesom Jul 8 '16 at 14:33

I recommend Python scripting with QGIS. The library is named PyQGIS. It has Vector and Raster GIS functions. QGIS is also a desktop GIS application that you can manually work with to understand various workflows. Here is a nice online cookbook containing many code snippets - http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/

  • 3
    This is the best option, especially since with the OSGeo4W installation you can call high-level geoprocessing algorithms from a number of other open source GISs (GRASS, SAGA etc) and also integrate R code. The only other thing going is arcpy, and that its a very expensive option. – obrl_soil Jul 6 '16 at 22:24
  • Jupyter notebooks, which the OP mentions, are not really the same beast as Python scripting within QGIS at all. – John Powell Jul 8 '16 at 8:54
  • John, the original post has been altered quite a bit. Jupyter was not mentioned in the first version. – klewis Jul 8 '16 at 16:00

There are a lot of different libraries for geoprocessing. Depending on your particular needs could be convenient to use one or another. Even though, it is possible to combine many of them using using a common format or datatype. Here is a small list of the libraries I'm using at the moment.


The so called "Swiss knife of GIS"


Manipulation and analysis of geometric objects in the Cartesian plane. Basically a GEOS wrapper


A matplotlib extension for plotting geometric/geographic objects

As I said, if you check how to translate (cast) from different instances you can do almost anything. For example, using GDAL you can translate into numpy arrays or images for doing:

Machine Learning and spatial regression:

And even web apps:


Django's spatial extensions

And of course the QGIS wrapper mentioned by klewis

  • Thank you, but all the cited libraries are relativelly low level. I found geopandas, that it is the closest one to my needs, but it works only with vectors and it is still pretty immature (altought promising) – Antonello Jul 6 '16 at 20:20
  • 1
    I'm not sure I understand what you mean by "high-level." – Paulo Raposo Jul 6 '16 at 22:12
