Digital Geography

SciPy integration in ArcGIS

Most of GIS users today will probably work with ArcGIS. Since version 10 the implementation / integration of Python into the ArcGIS framework and ArcPy it’s important for ArcGIS users to be aware of the capabilities of using Python in batch processing tasks, data manipulation and the broad possibilities of Python itself (eg. Numpy, Sympy etc.). SciPy will another topic for the future…

How many people live in this area?

Not long ago I was tasked with finding out how many people live within an arbitrary polygon. In this particular case, the polygon represented the portion of the United States within a drive-time of 10 hours. For this example, the polygon(s) can be anything you wish. This post will act as a tutorial of sorts on how to answer questions like these using python. Sorry to my Deutsch Freunden on this site, but this will be a U.S based answer as using the Census API is a key part of it. This is a classic case of the modifiable area unit problem.…

How to build your own QGIS plugin

Since I’ve created the QGIS plugin qgis2leaf I was surprised how easy it is to create a plugin for QGIS. In this post I would like to show you how to build a basic buffer-plugin and give some tips for debugging and developing. the plugin template QGIS plugins are competely build in Python: the UI can be designed with QT designer using PyQT. The whole logic of the plugin needs to be written in Python as well. But lets be honest: It would be great if you would have  a starting point. In QGIS there is a plugin for this called…

Anaconda: a interesting Python distribution

When working with GIS and statistical data there is an emerging need to know some scripting language. Python is one of the most widely used. It is not perfect but it is like a geographer: fairly good at nearly everything: “For scientific purposes, when writing a small specialized script, Python may often be the second best choice: for linear algebra, Matlab may have nicer syntax; for statistics, R is probably nicer; for heavy regular expression usage, Perl (ugh) might still be nicer; if you want speed, Fortran or C(++) may be a better choice. To design a webpage; perhaps you…

NeoCartography and the need to code

The time when I studied Geography and Mathematics is long ago. So I chose Cartography as one major part of my studies and learned to draw circles and a good cartographic representation of discrete values as an example. As I have chosen this field of cartography and GIS I am well aware of the changes that came to this fields. Especially Cartography made big leaps to be more represented by Geoinformatics than those traditional map makers. And I would assume that it is hard for Geographers and Cartographers to catch up with all those fancy programming stuff. Nevertheless I think…

Python Script for “depth vs. data” plots

Today I want to share a Python script that I wrote to plot some lab data against the core depth it was taken from. I know its not very special if you are a Python guru, but I know that many students and scientists have problems to visualize their data in a proper way. My idea was to collect some ideas and developers who are interested to test and to enhance the script. Also, I want it to be open source, so feel free to fork it on GitHub or give feedback. The usage is not that easy at the moment,…

QGIS Plugin – Profile Tool

Previous Posts in this series QGIS Plugin – RasterCalc QGIS Plugin – OpenLayers   So, this will be a pretty quick post on one of my most used QGIS plugins, the Profile tool. The Profile tool can be downloaded from the central QGIS plugin repository HERE. In a nutshell, the Profile tool allows you to draw a line in your QGIS project area and get the profiles of various layers in your project, as seen here: The most obvious use of this tool is looking at terrain profiles, and it certainly is very useful for this. However, in the example…

Map Projections, spatialreference.org and gdalwarp

Map Projections The question of map projections and how to reproject data is one that comes up often in discussions with both experienced colleagues and those new to the geospatial profession. I’m not going to go through a complete discussion of map projections here, as there are many resources available on the Internet that can help you. I’m going to focus more on how to move data between projections. At its most simple a map projection is simply a mathematical description of how to take data on the surface of a sphere, that are inherently 3-dimensional, and transform them to…

Springerlink Downloader for Springer Books

Springer and the sword of VPN Many universities own licenses to get access to the content of scientific oriented publishers. Using a VPN-tunnel every enrolled student every student has the possibility to explore this content online. Sometimes you’ll find whole books online you would like to save locally maybe. This donwload isn’t that easy as each book is separated into chapters which needs to be downloaded seperately and merged by zusing some exterior program like pdfsam. It is not unlikely to own a whole bunch of pdfs without any order.

QGIS Plugins — OpenLayers

Click for previous article in this series about RasterCalc How often have you been working on a project in QGIS and wanted some nice background imagery, perhaps for a quick and dirty evaluation of your own data? I find I need this with growing frequency and a great way to do it is through the OpenLayers plugin for QGIS. Of course, if you know of a good WMS for your area of interest you can always go that route, but the OpenLayers plugin is a great addition to your QGIS toolbox. The OpenLayers plugin is available through the official QGIS…

Python for Geospatial Data Analysis (Part IV)

GDAL Geotransforms and World Files The last post in this series considered how to write a geospatially aware file, in that case a Geotiff. In the example the projection and geotransform were read from a file and written into another file with no modification. That worked for the simple example, but isn’t necessarily the most common use case for that type of subroutine. Often you may want to adjust the data based on your analysis. Most geospatial professionals are probably familiar with world files, or have at least run across them. They are a good way to georeference data that…

Python for Geospatial Data Analysis (Part III)

Writing Geospatial Files In the last post in this thread I began discussing basic syntax and how to open and read a geospatial raster file. This installment in the series will demonstrate how to take the data we read from the file and write it out to a new file. In this case, we won’t change anything in the data, just use it as a means to demonstrate writing a file. In order to write a file, there needs to be a small addition to the subroutine for reading data. In the previous post the subroutine didn’t return the data…

Python for Geospatial Data Analysis (Part II)

Reading Geospatial Files In the last post in this thread I provided a bit of background and some simple instructions for installing python and the necessary modules for geospatial analysis. In this post I will cover some basic python syntax and reading raster data from a geospatial file. Let’s get started. Python files typically end in the extension .py. In a OSX/Linux environment, the first line in your file should be the interpreter you want to use. On my macbook, my python executable is /opt/local/bin/python, so the first line of my file is After this, you need to load the…

Python for Geospatial Data Analysis (Part I)

For my first post on digital-geography.com I wanted to begin a discussion on a topic I have strong feelings about, Python. A common question I get from students and experienced colleagues is “What analysis environment do you use?”. Where I work most people use either IDL/Envi or Matlab for raster data analysis. These are good packages, with many advanced capabilities, but they can be restrictive. IDL or Matlab code can be difficult to move from system to system or share with others because both environments require licenses that can be quite expensive. That is particularly a problem if you are…