todorus / openkaart-api

0 stars 0 forks source link

As a developer, I want a seed dataset to work with #18

Closed todorus closed 7 years ago

todorus commented 8 years ago

Geojson data of Provinces, Municipalities and Postal Codes and their relation to each other (which contains which).

Instructions how to seed this database

todorus commented 8 years ago

I found a way to scrape recent data from the dutch Bureau of Statistics 3fbc5faa22e4de24632a83609da8ad7f40ff6b68, but this data is not in the standard CRS for GeoJSON (which is EPSG:4326).

I need to find a way to automate the scraper to download the data, look up the input format and use a converter for that input format. Maybe execute a shell command and let ogr2ogr run, but I'd rather use a python lib, so any other devs do not need to download dependency like ogr2ogr

todorus commented 8 years ago

2bac185fcf70e2b789ce338a397fe7452b429d2e scrapes files with the correct projection for Leaflet and Google maps.

CBS data is very clean and recent, but CBS does not seem to have data on postal codes. The owner is probably PostNL, but this is a private company and government regions seem based on postal codes as well. I suspect that the government does not use postal codes, but converts postal codes to another regiontype by geocoding. Maybe municipality or the grid that CBS mentions.

Edit: My suspicions are confirmed by the CBS. Postal regions are determined by the postal company and can be intersected by municipal regions: source

todorus commented 8 years ago

Found a WFS service for addresses in the Netherlands from the BAG. It contains (virtually) every address in the Netherlands and which city and postal code it belongs to. It does not contain a reference to the municipality, but has a point as geometric data.

This point can be used with a contains() operation on the polygon data of the municipalities to link an address to a municipality. This in turn can be used to link postal codes and cities to a municipality. Postgres with the PostGIS plugin should be able to do a contains operation

todorus commented 7 years ago

The NLEXtract project already downloads the address data from BAG, enriches it with municipality and province labels and converts it to one CSV file. This is published monthly here: http://data.nlextract.nl/bag/csv/

todorus commented 7 years ago

this needs to be tested with a simple webclient to see if it is usable as-is