Import data from OpenStreetMap to QGIS
The amount of data in OpenStreetMap Is really broad, and although it is not fully updated, in most cases it is more accurate than data traditionally raised through 1 scale sheets: 50,000.
In QGIS it is great to load this layer as a background map such as the Google Earth image, for which plugins already exist, but this is only a background map.
What if you want to have the OpenStreetMap layer as a vector?
1. Download the OSM database
To do this, you must choose the area where you expect to download data. It is obvious that very large areas, where there is a lot of information, the size of the database will be immense and time consuming. To do this, select:
Vector> OpenStreetMap> Download
Here you select the path where the xml file with the .osm extension will be downloaded. It is possible to indicate the quadrant range from an existing layer or by the current display of the view. Once the option is selected Accept, The download process starts and the volume of downloaded data is displayed.
2. Create a Database
Once the XML file is downloaded, it is required to convert this into a database.
This is done with: Vector> OpenStreetMap> Import topology from XML ...
Here we are asked to enter the source, the DB SpatiaLite output file and if we want the import connection to be created immediately.
3. Call the layer to QGIS
Calling data as a layer requires:
Vector> OpenStreetMap> Export topology to SpatiaLite ...,
It must be indicated if we are going to call only points, lines or polygons. Also with the button Load from the database you can list which are the objects of interest.
As a result, we can load the layer onto our map, as shown in the following image.
Of course, because OSM is an open source initiative, it will take a lot for private tools to do this kind of thing.