I am trying to import Polygons from OSM to QGIS 2.0, but so far I have no idea how to do that.
E. g.: Kisterseg auf Tatabanya in HU:
http://www.openstreetmap.org/?relation=1027806
Is there any fast way to get the polygon into qgis?
I am trying to import Polygons from OSM to QGIS 2.0, but so far I have no idea how to do that.
E. g.: Kisterseg auf Tatabanya in HU:
http://www.openstreetmap.org/?relation=1027806
Is there any fast way to get the polygon into qgis?
Unfortunately, the new OSM import in QGIS 2.0 does not support multipolygon relations from OSM in an easy way. So you have to use a workaround:
http://www.openstreetmap.org/api/0.6/relation/1027806/full
Vector -> Openstreetmap -> Import Topology from XML
Vector -> Openstreetmap -> Export to Spatialite
selecting the database you created in the step before, and polygons for output.
If you want all border polygons from a country, you might be quicker with a postgis database filled with osm2pgsql. This will create polygons from multipolygon and border relations automatically. You can then load the data into QGIS.
Use JOSM and load according relation id. JOSM allows to save as *.gpx which can be opened by QGIS
Another alternative is to use OpenJump which, from the PLUS version 1.6.4, is able to read OpenStreeMap XML files natively using JOSM code for its OSM driver. From there export and import to QGIS is a trivial task.
Yet another way, this time using gdal:
curl -o Tatabányai_kistérség.osm http://www.openstreetmap.org/api/0.6/relation/1027806/full
ogr2ogr -f SQLite -dsco spatialite=yes Tatabányai_kistérség.sqlite Tatabányai_kistérség.osm --config OGR_SQLITE_SYNCHRONOUS OFF --config OSM_USE_CUSTOM_INDEXING NO
ogr2ogr -f GeoJSON -dsco spatialite=yes Tatabányai_kistérség.geojson Tatabányai_kistérség.sqlite -sql 'select * from multipolygons'
I chose GeoJSON as an output format as it can handle longer field names than a shape file. You might also want to modify your system's osmconf.ini if you need custom field mappings. This approach works with all of the data sets I've tried. It builds tidy polygons, and isn't troubled by ID issues like the old QGIS plugin.