This repository contains:
-
Data export of all German streets (including postal codes, localities and regional keys) from the OpenStreetMap project.
-
List of communes (municipalities) in Liechtenstein.
This dataset is an extract from the regional OpenStreetMap file for Germany germany-latest.osm.pbf. The following algorithm is used:
-
Read in all postal code areas (OSM relations), municipality areas (OSM relations), borough areas (OSM relations), suburb areas (OSM relations) and streets (OSM ways) together with their geometric information.
-
Include only ways which have one of the the following properties:
Name Value place
square
leisure
park
highway
primary
highway
secondary
highway
tertiary
highway
residential
highway
living_street
highway
road
highway
unclassified
highway
footway
highway
pedestrian
highway
track
(but only fortracktype=grade1
)highway
service
(but only forservice=alley
)and have NOT any of the following properties:
Name Value access
private
access
forestry
access
military
-
For each OSM Street, determine the geometric centre and in which municipality and postcode area it is located. Where available, the borough area and/or suburb area should also be taken into account.
-
Create a new street object (name, postal code, locality, regional key, borough, suburb) from the combination of 5 data objects (OSM street, OSM municipality area, OSM postal code area, borough OSM areas, suburb OSM area).
-
Shorten all street names with
strasse
orStrasse
tostr.
orStr.
. -
Ignore all streets with names matching the following regular expression:
^(\?|\+|-|_|\d*|\(.*\))$
. -
Export all street objects to CSV (file
streets.csv
).
Despite filtering the data, the resulting CSV file streets.csv
contains streets that are unusable or even incorrect. For example:
-
Small footways (often with strange names) that cannot be distinguished from usable ways.
-
Streets that do not match the postal code area 100% and therefore appear twice with different postal codes and municipal assignments (yes, this is not always wrong).
To solve this problem, we have introduced an additional csv file called streets.ignore.csv
. This file is used to automatically create (via GitHub Action) a third csv file called streets.updated.csv
by removing all streets from streets-csv
that are contained in streets.ignore.csv
. The streets.ignore.csv
file is maintained manually.
The data in the OpenStreetMap project is not perfect, but surprisingly well maintained for Germany.
-
A total of 121 municipality regional keys from the official GV100AD (Gemeindeleitdatei) are not represented. This is largely due to the fact that these are areas without buildings and proper roads.
-
Streets and their postal codes or their municipality keys are determined on the basis of geometrical comparisons. This procedure is not 100% perfect.
-
Street names, postal codes and municipality keys are subject to constant change. The OpenStreetMap project as a community project tries as best as possible to update its data regularly. Current changes in streets and postal codes are documented quarterly by Deutsche Post (see Deutsche Post Direkt), current changes in municipality assignment in the Gemeindeleitdatei of the Federal Statistical Office (Destatis).
Since there is no official list of municipalities in Liechtenstein that is machine-readable, we have created our own list as a CSV file based on information from Wikipedia.
Yes, that would be much appreciated. The best way to help is to post a response via the Issue Tracker and/or submit a Pull Request.