Monday, 18 November 2019

qgis - Combine Shapefile with address information



I downloaded a UTM32 shapefile (.cpg, .dbf, .prj, .shp, .shx file, where other available georeferences are GK3 and TM32) that shows the exclusive division of Germany in its municipalities. Above, I have a large dataset of subjects with their postal addresses (street, house number, zip code, city).


I would like to assign each subject to exactly one municipality using the postal address. I want the corresponding municipality's id (saved as attribute in the shapefile) to be attached to each subject in my database and export it, say, in a csv file.


However, I am not sure how to combine the shapefile with the addresses. I can imagine two approaches:



  1. Using Nominatim or other services I could geocode the postal addresses, i.e. convert them into lat/long coordinates. Let's assume for a second that I already did.



How can I add coordinate information to the shapefiles in order to achieve the assignment of subjects?



  1. There are also shapefiles for German Streets (Open Street Map etc.). Let's assume I have access to such data.


Is it in principle possible to place the municipality and the street layer on top of each other, locate each address on the street layer and identify the corresponding municipality on this basis?


Which one is practical?


I am using QGIS 2.6 and Mac OS X Yosemite.



Answer




  1. You could geocode the adresses: For example with http://www.gpsvisualizer.com/geocoder/



or the MMQGIS-Plugin:


enter image description here


Then do a spatial join:


enter image description here


enter image description here


And there you have the assigned Municipalities:


enter image description here


For measuring the point density you could count the points per polygon: enter image description here enter image description here


Or use the Heatmap-Tool (Raster --> Heatmap)



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...