I've made a map in which buildings in a city are displayed using shapefiles from Geofabrik and unfortunately, none of the shapes contain the housenumber
.
When I download the .osm
files from Geofabrik the multipolygon layer is empty, but when I download the OSM Data directly via the OSM download tool in QGIS, the multipolygon layer contains buildings, but only if the area where I download it is very small (roughly 30 buildings at a time).
Is there a way to get the multipolygons from OSM other then downloading 30 buildings at a time, then when those are downloaded, extract the housenumber
from the other_tags
field in the attribute table?
Best Answer
The OpenStreetMap Wiki is your friend: http://wiki.openstreetmap.org/wiki/Map_Features. You can also get a lot of good information from here: https://taginfo.openstreetmap.org/keys/addr:housenumber#combinations.
You may need this:
http://learnosm.org/en/osm-data/osmosis/
and this: https://wiki.openstreetmap.org/wiki/Key:addr
This command line was not tested but can show the way:
osmosis --read-xml your_osm_file.osm.bz2 --tag-filter accept-nodes addr:housenumber=*, addr:street=*, other_tags_you_may_need --write-xml roads.osm
Or you can import to PostgreSQL using osm2pgsql: http://wiki.openstreetmap.org/wiki/Osm2pgsql and use a custom
style
file: https://github.com/openstreetmap/osm2pgsql/blob/master/default.styleOsm2pgsql is simple to use but you must know how to do a good tunning or it will take a century to import your data.
osm2pgsql -C 2500 -c -d database_target_table -U postgre_user -W -s -S ./your_style_file.style your_osm_file.osm
EDIT: Creating a table to make the things easy. This will be necessary when you need to create a Geoserver Layer.
Pros: Will be easy to locate just what you need.
Cons: You will duplicate the data and will be hard to update later (want to use a view?).
In this example I'll create a table
route-tunnels
fromplanet_osm_line
with all tunnels. You just need to search for your data inaddr:housenumber
column atplanet_osm_line
table. Remember: As far as I know, not all streets will have house numbers. I think it will be inplanet_osm_polygon
table if you importbuilding:*
too.https://taginfo.openstreetmap.org/keys/building#combinations