Hi, is there a way to extract just certain data from a specific country from that massive OSM file? I would like to retrieve the German zip codes, the city names including the parts of town and LAT and LON. Export format maybe something like csv or xml. Is that possible in some sort of automatic way? There are free databases that provide nearly everything of my desired data but the parts of town and their specific LAT and LON are always missing. Thank you guys for your ideas. asked 19 Jan '22, 13:51 Bingoboy1234 |
You can do it but it is not trivial. The easiest way is probably importing the data into a PostGIS database with answered 19 Jan '22, 13:58 Frederik Ramm ♦ Thank you, Frederik. That sounds complicated. I need to train myself with PostGIS. By now I am unfortunately only used to MySQL. Can I compute the polygon centroid automatically for the whole of all German parts of towns in one go or do I need to do that by hand for each city? Latter could become a job without an end.
(31 Jan '22, 10:22)
Bingoboy1234
|
I am not sure what the status of osm-to-mysql importers is. I suspect it will be easier for you to get to grips with PostgreSQL than to try and import to mysql - the difference in terms of SQL should be minuscle. Of course you can compute the centroid for all parts of towns in PostGIS, something like
After that, add those that were already present as points
You might also want to add the admin boundaries on levels above 8 to the mix. And later to find out which city something is in,
Because in Germany some cities ("kreisfreie Städte") have an admin_level of 6 you will want to re-run the last query for those points that didn't have an admin_level 8 parent:
answered 31 Jan '22, 10:37 Frederik Ramm ♦ |