I am currently trying to import all administrative boundaries (countries, states, cities, etc) from OSM.
I downloaded a small file from Geofabrik (Corsica), in order to run my tests. I understand that I could run the same operation worldwide using planet-latest.osm.
First, I extracted all boundaries using the following command like
osmosis --read-xml file="corse-latest.osm" --tf accept-ways boundary=administrative --used-node --write-xml out1.osm
Then, I import everything into PostgreSQL using
ogr2ogr -f PostgreSQL PG:"[connection details]" out1.osm -lco COLUMN_TYPES=other_tags=hstore
Which fills up the multipolygon table with the list of cities, and that is exactly what I wanted.
However, if I look for "Ajaccio", there is a lot of useful tags associated with the node 51341115, that do not show up in the multipolygon. Instead, they are associated to a point linked to that node ID.
In the XML file, I have been able to link that point to the relation 73283, inside of which are standing all the ways of the city, and the tags that I actually find in the multipolygon table.
The question is then the following: how can I link the multipolygon to the point in order to extract the tags, using solely the database?
I'm not specifically tied to those tools, I'll use anything that works and that spares me writing code.
Many thanks :)