Reputation: 69
to build up a database of German cities where ic can query cities around a cup with a defined distance, i want wo export from pbf files the address data into a mysql database. I already found a good source where i can get the pbf files, but could not find a tool to export the data i want/need. perhaps somebody has had already the same problem and can help me out wit a link here.
i only need the zip, city, street and lat/lon, no map data or vector data
Georg
Upvotes: 0
Views: 955
Reputation: 35118
You can use imposm to import data to a PostGIS database. Maybe it is an option to use PostgreSQL instead of MySQL, because PostgreSQL is more common in the OpenStreetMap world and you might find more tools for this.
You can customize the imposm schema to leave our the geo data you do not need.
Another way would be to use osmosis:
There is a --write-mysql
switch:
https://github.com/openstreetmap/osmosis/blob/master/doc/detailed-usage.adoc#write-mysql-wm
So something like this should work:
./osmosis --read-pbf germany-latest.osm.pbf \
--tf accept-nodes place=city,town,village \
--tf reject-relations --tf reject-ways --lp \
--write-mysql database=test user=*** password=***
Upvotes: 0