This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

extracting buildings from osm spatialite database

0

Hi,

I downloaded OSM data from Geofabrik and saved it in a Spatialite database. Now I want to select all the buildings from my region and save it in a separate table. Is there a way to do this in Spatialite with a Inner Join between the osm nodes id/tags tables and the way id/tags tables?

asked 10 Sep '17, 18:42

terra03032006's gravatar image

terra03032006
11112
accept rate: 0%

1

How did you convert from .osm.pbf (or .osm.bz2) to Spatialite? The software used for that will determine the options you have.

(10 Sep '17, 18:48) Frederik Ramm ♦

I used the spatial_osm_raw tool like this: spatial_osm_raw -o region.osm.pbf -d my_data.sqlite

(10 Sep '17, 18:52) terra03032006

Are you really sure you want to go down this (hard) route which would require that you manually collect the nodes for building ways (as well as the ways and nodes for building relations!) when using spatialite_osm_map (instead of spatialite_osm_raw) promises to handle all this for you automatically?

(10 Sep '17, 18:56) Frederik Ramm ♦

I am not using these tools myself but when searching for the name of the tool on the web, I found https://www.gaia-gis.it/fossil/spatialite-tools/wiki?name=OSM+tools which seems to explain that spatialite_osm_map already gives you tables for the individual feature types, including (I suppose) buildings!

(10 Sep '17, 19:00) Frederik Ramm ♦

ya but I want to work with the raw data, are there some links which can help me to achieve my goal?

(10 Sep '17, 19:11) terra03032006