Tag Archives: geoprocessing

Review of Swiss GIS Day 2012

As announced a while ago, I went to GIS Day in Zurich, Switzerland.

On my employer’s blog, I have written up a review of the event in German. Head over to find out about interesting Switzerland-based GIS projects (in-browser-translation should be fine to get the gist, I suppose).

Swiss air rescue organisation Rega uses GIS for emergency dispatching

Swiss air rescue organisation Rega uses GIS for emergency dispatching

Projection from WGS1984 to Swiss national grid (CH1903 LV03)

In my last project I used (standalone) Python for geoprocessing. Since ArcGIS or something like that was not there to help with projecting geodata from one coordinate system to another, I wrote a function which converts well-known WGS1984 to Swiss national grid coordinates (SwissgridCH1903 LV03).

Swisstopo has the formulas of an approximate transformation and also funtions in C#, Javascript and PHP, but not in Python. So here is to your disposal:

def projWGS1984ToCH1903(x, y):
  """Converts coordinates from WGS1984 to CH1903_LV03 using the
     method from http://www.swisstopo.admin.ch/internet/swisstopo/
     de/home/products/software/products/skripts.html, returns a
     list [x,y]
     :param x: x coordinates in degrees in WGS1984 :
     :param y: y coordinates in degrees in WGS1984 """

  # Transformation into sexagesimal seconds
  x = x * 3600
  y = y * 3600

  # Latitude and longitude difference to Bern
  x_fact = (x - 26782.5) / 10000 # LAMBDA
  y_fact = (y - 169028.66) / 10000 # PHI

  x = 600072.37 + 211455.93 * x_fact - 10938.51 * x_fact * y_fact - 0.36 * x_fact * y_fact**2 - 44.54 * x_fact**3
  y = 200147.07 + 308807.95 * y_fact + 3745.25 * x_fact**2 + 76.63 * y_fact**2 - 194.56 * x_fact**2 * y_fact + 119.79 * y_fact**3

  return [x, y]

Py all means

Over on his blog, Bill Dollins muses about the range and ubiquity of the Python language in the geospatial realm.

It’s true – if you work with ESRI products on a daily basis (like I do) you almost can’t get away without using Python one way or the other, be it for scripting some workflow, writing some standalone programme with or without using ESRI’s arcpy or implementing advanced Field Calculations in ArcGIS. The most important upside about the ubiquity of Python to me is the availability of great packages. In my work I have for example used such diverse packages as EXIF.py for manipulating EXIF data in images (think extraction of geocoding information from photos), suds for accessing SOAP services and Numpy for handling computations in, and manipulations of, rasters.
Very recently I tested map production automation in ArcGIS using the arcpy.mapping package. Part of the task encompassed automatically adapting the map title in accordance with changing map content. The title was put into a relatively small text box and I had thus to find a way to make sure that both a string of say ten characters as well as 25 characters could fit in the space. After some digging I came across a nice package called PyHyphen which I could include into my script for hyphenating the title string and thus perfectly solving my problem. It even came with a German dictionary which handled names of Swiss municipalities well!
Also very recently, I finished a study on the threat nuclear power stations present to people living in their (more or less immediate) environment. The geospatial part of that study was – except for a small bit of the open source statistics software R thrown in there – completely done in Python. And if I had already been aware of rpy which Bill mentions in his post, I might have been able to pull off the entire analysis in Python.

I think Python is here to stay for a while. In the geospatial realm which works with ESRI it has always been clear that Python is the next thing after AML and VBA/ArcObjects. But it’s very good to see that Python in fact has a much broader base than just the ESRI products in the geospatial realm and certainly beyond that. And I also really like that it runs on my Ubuntu desktop as well.

Gefährdung der Bevölkerung der Schweiz durch Kernkraftwerke: Eine Analyse

(Deutsch weiter unten)

Things have been a bit silent around here for the last days. That’s because I have been busy with a private project of mine: doing a spatial analysis of the exposure of the Swiss population to the dangers of nuclear power plants and writing a report about it.

The processing was done with federal census data and locations of nuclear power plants which I derived myself. I have written up the results in a report in German, so as to suit the intended audience (however, the diagrams in the report should be quite intelligible even if you don’t speak the language). For the same reason I’ll switch to German now.

Über die letzten Wochen habe ich ein privates Projekt verfolgt: Eine Analyse der Gefährdung der Schweizer Bevölkerung durch Schweizer Atomkraftwerke (AKW) und Atomkraftwerke im benachbarten Ausland. Die Leitfrage der Analyse ist:

Welche AKW setzen wieviele Menschen in ihrem Umland einer Gefährdung aus?

Untersucht wurden acht AKW in der und um die Schweiz. Die Analyse kann hier heruntergeladen werden:

"Gefährdung der Bevölkerung der Schweiz durch Kernkraftwerke - Eine Analyse" im PDF-Format: Rechtsklick zum Herunterladen.

Es folgen einige zentrale Abbildungen aus der Analyse.

Untersuchte AKW in der und um die Schweiz

Die Analyse verwendet Daten der eidgenössischen Volkszählung 2000 und die Standorte der AKW. Das Resultat der Analyse sind Diagramme and Statistiken über die Verteilung der Schweizer Bevölkerung um AKW in Abhängigkeit von der Distanz.

Bevölkerungsdichte um AKW

Für jedes AKW kann die Anzahl der von einem Reaktorunfall innerhalb einer gewissen Distanz betroffenen Menschen ermittelt werden. Die Resultate können sie dem Dokument entnehmen, das Sie weiter oben herunterladen können.

Ich hoffe, dass meine Analyse als eine objektive Grundlage im aktuellen energiepolitischen Diskurs dienen kann.

Für Auskünfte zur Analyse, den Bezug des von mir erstellten Quellcode oder der rohen Resultatdaten (aus rechtlichen Gründen nicht aller Eingabedaten), schreiben Sie mir am besten ein Mail.