Download map data using the QGIS

This time made some use of geographic positioning and navigation information series of work, which is a very important part of how to get to the map data such as road vector, raster map of a region, the main tool I used was QGIS . QGIS is a free cross-platform application, which integrates a number of functions for vector, raster processing, but also integrates a number of open data site map interface, such as OpenStreetMap, etc. Therefore, in the data acquisition and processing to us formats require very convenient. This post describes how to use QGIS to download data, and processed into a specific format.

A designated area designated feature vector acquisition

We often encounter such a demand: Get a designated area of ​​a map feature, such as access to certain areas of the road map, river map. The content of this section to address this need. Usually we download vector map of a region from the open map in OpenStreetMap platform, and then through subsequent processing to obtain the map the information we need.

1, data download

1) Select the vector OpenStreetMap in the menu bar -> Download Data, you can open the box to download the data:

 

2) then the data set required to download area, where the arrangement provides three areas:

Area of ​​the current window display: a) From map canvas

b) From layer: the layer represents a region

c) Manual: artificially set region

When area data is generally known to us that we need to download, we adopt the third way.

 

3) Download Data: After setting the download area and enter save file name, click OK, it starts downloading the data. One thing to note here is that when setting the save file name, file extension need to bring that .osm, so that when subsequent load file, it can not find the file does not appear.

 

2, designated feature extraction and vector remain

Previous downloaded data is stored in the form of xml, not a vector graphics format, and therefore can not be directly processed. We need first of all the files loaded into QGIS and converted to vector data, to the next step of the process.

1) osm file is loaded: Select vector-> Import Topology from XML, open data import page: 

Select the file (that is, we have just downloaded osm files) to be imported, set the conversion after the file name, and click OK.

2) Export vector graphics: Select vector-> Export Topology to SpatiaLite, open vector graphics Export Page: 

Because here we need to get that road data, so we "export type" select Polylines; then export the settings file name; and finally need to export tags. Select Load from DB, and select the label of interest. Here we are only interested in the road, so we select only the highway. The purpose of the label is reserved for further screening, although we chose Polylines in the "export type", but it is not all Polylines road (there may be rivers, etc.), hence the need for further screening. 

3) screening of the feature of interest: 

The resulting vector above, includes not only the road map, the feature also includes other features, requiring further screening.

On the layer obtained the right to open the Options menu, choose Open Attribute Table: 

Select select by expression (red circle in the drawing), and then filtering setting conditions. Here we need to choose the road, so our screening conditions: NOT ( "highway" = 'NULL'). After the set point select button, you can see, the road section is highlighted in yellow.

 

Then we open the Layers window context menu, select Save, open the saved page:

 

Set to save the file name, geographic coordinate system, pay attention to check the red circle option, choose to save, to obtain road vector in the region.

Second, the designated area acquisition raster

1. Set download URL

Find Tile Server (XYZ), right, New Connection in the Browser Panel window:

Enter the URL of the server, for example:

High German image maps:

https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}

High German road network:

https://wprd01.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scl=2&style=8&ltype=11

At this time, the server will generate a map interface.

2, raster map layers

Double-click the server map above interface to create, that will generate a response of the layer in the Layer Panel. At this point, if we know the geographic coordinates of the area to be downloaded directly to the third step. If you do not know, you can open a reference map, by manual selection, set the download area. Specific practices:

Open web-> OpenLayers plugin, select the map you want: 

By then zoom, drag and other operations, set the map to the area we need: 

3, save the required grid map

On the creation of a raster layer, right click and select Save, open the saved page: 

Setting saved path, geographic coordinate system, the range (Extent), resolution (Resolution), click OK, and raster map data will be downloaded. If you save a lot of range, usually the map is divided into several smaller areas to save. 

Related operations, can refer to video: https://www.bilibili.com/video/av65061459/

Guess you like

Origin www.cnblogs.com/doctor-li/p/11402774.html