Viele Daten, die man erhebt, sind örtlich gebunden. In R kann man solche Daten sehr schön mit dem Package sp darstellen. Alles, was man braucht sind:
- Kartenmaterial: Also Beschreibungen der Kanten. Eine sehr gute Datenbank hierfür ist die GADM database of Global Administrative Areas. Für Deutschland gibt es dort eine Karte aller Kreise, die als R-Datenobjekt gespeichert sind – nett oder?
- Daten, die einen lokalen Bezug haben. Viele gibt es in Genesis Datenbank des Statistikportals dem gemeinsamen Datenangebot der Statistischen Bundesämter. Ich hab’ mir vorgenommen einfach mal die Anzahl der Krankenhausbetten zu plotten. Hier ist das Ergebnis:
Hier sind die Schritte – eine ausführliche Beschreibung in englisch findet Ihr hier. Viel Spaß beim Verbessern!
usual setup packages and directory
?Download geographic.R
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | require(sp) require(RColorBrewer) setwd("/Users/gerrit/Desktop/mapping/") #load the map load("DEU_adm3.RData") NRW<-gadm[gadm$NAME_1=="Nordrhein-Westfalen",] #comment to plot whole BRD #improve umlaut-coding NRW_names<-iconv(NRW$NAME_3, "ISO_8859-2", "UTF-8") #load the geo-tagged data health<-read.table("/Users/gerrit/Desktop/mapping/Deu_Betten.csv", header=T, sep=";", dec=",", na.string=c("-", ".")) #match map and geo-data total <- length(NRW_names) order <- vector() for (i in 1:total){ order[i] <- agrep(substr(NRW_names[i], 1, 6), substr(health$ORT_NAME, 1,6), max.distance=0.1)[1] } cbind(NRW_names, as.character(health$ORT_NAME[order])) #Check the matching #set colors col_no<-as.factor(as.numeric(cut(health$KH_BETTEN[order], breaks=c(1, 500, 1000, 1500, 2000, 2500, 3000, 3500, 100000)))) levels(col_no) <- c("NA","0-500", "500-1000","1000-1500", "1500-2000","2000-2500","2500-3000","3000-3500", ">3500") NRW$col_no <- col_no myPalette<-c("black", brewer.pal(8, "Purples")) #plot it spplot(NRW, "col_no", col=grey(.9), col.regions=myPalette, main="Hospital beds in NRW by district") dev.print(png, file="Krankenhausbetten_NRW.png", width=10, height=7.68, units="in", res=72) |
There is an already excellent introduction here. switch to German to see a short version of this.

Pingback: GIS on a shoestring – Getting traveltimes from google | Sustainable Research