Digital Geography

CSV to SHP with Python

Python is a well established script language in the GIS/geodata world. And as a Facebook friend asked how to read csvs with Python I thought about “How to convert a csv to a shp with Python?”. Keeping in mind that most GPS solutions and many internet tools offers a csv export and it’s common in any stats/spreadsheet program this can be a handy solution for your everyday life. See my solution here…

AHP for ArcGIS 10.x using Python

When it comes to site selection problems or suitability models, the spatial Multi-Criteria Analysis (Weighted Overlay) is the most commonly used method. It’s easy, simple and popular. However, if it’s your first time to come across this method, it’s highly recommended to have a look at this link. After defining the problem you want to solve, the next 4-steps are followed to perform this method. Determine significant layers. Reclassify the layers. Weight the input layers. Sum up the weighted layers My concern was always about how I can assign a weight to each layer in a kind of scientific way.…

Geocoding Addresses in ArcGIS: the other approach

Today I stumbled upon a post from the German ESRI office and their blog gisIQ and a little tutorial (English translation) on how to geocode addresses in the ArcGIS platform. I was asking, whether there is a possibility to use other geocoders as well and so I tried to build my own solution without credits and with the possibility to choose a geocoder. Fortunately the Python world offers some nice little scripts. So let’s use geopy!

Creating ARCs in QGIS: The Python Way

So I came across this nice little project which focussed on trip planning and route over large distances… And there was this nice little post from Nathan Yau at flowingdata.com where he describes the making of great circles from one point to different other points in R and the other example from Anita Graser where she shows how to deal with an Arc in QGIS but using postgis functionality. So what about QGIS itself and a programmatic way? See yourself…

A small tool with Python: the shapefile archiver

Let me introduce to you, guys, my first Python tool: “Shapefile Archiver”. Usually, I face lots of problems in managing my shapefiles. My first problem is backing them up in a decent way, especially, before starting some experimental things on them (That sounds scary!), while the second problem is that Finder/Windows explorer doesn’t tell me about the shapefile more than its name!. Moreover, Finder/Windows explorer shows the shapefile as a bunch of files (*.shp, *.prj, *.shx, *.dbf,…) which makes me feel annoyed especially because I’m too lazy to open QGIS browser or ArcCataloge every time I want to explore my…

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,…