官术网_书友最值得收藏!

Reprojecting a layer

Layers may be in a CRS other than the one that is best for a given task. Although QGIS supports on-the-fly reprojection when rendering, other tasks, such as performing spatial analysis, may require using a given CRS or having all input layers in the same one. This recipe shows you how to reproject a vector layer.

Getting ready

Open the layer named Davis_DBO_centerline.shp from the sample dataset.

How to do it…

The Davis_DBO_centerline.shp layer uses a CRS with feet as the unit, which makes this unsuitable for certain operations. We plan to use this layer in future recipes to calculate routes and work in metric units, so including this in a CRS that uses them is then a much better option:

  1. Right-click on the layer name in the table of contents and select Save as....
  2. Select Selected CRS in the drop-down list to specify a different output CRS. Click on the Browse button to select a CRS. You will see the CRS selector dialog.
  3. You will be converting the point to the EPSG:26911 CRS. Use the filter box to find it among the list of available CRSs and select it. Then click on OK.
  4. Click on OK in the Save as dialog to create the layer. A new shapefile will be created with the projected lines.

How it works…

Reprojecting is done by the OGR library when it saves the file because this is one of the options that it supports.

There's more…

Raster layers can be reprojected in a similar way:

  1. In the Save as dialog, for raster layers, you can find a CRS field with a Browse button.
  2. Click on it to open the CRS selector, and select the destination CRS.
  3. When you click on OK, the raster layer will be exported using the selected CRS instead of its original one.
主站蜘蛛池模板: 资兴市| 大悟县| 威宁| 铜山县| 福建省| 青龙| 婺源县| 阳城县| 万盛区| 新河县| 咸丰县| 北辰区| 嘉鱼县| 陆良县| 观塘区| 金秀| 白水县| 昆山市| 双流县| 江源县| 宁国市| 建湖县| 宜昌市| 雷山县| 策勒县| 青龙| 金寨县| 罗山县| 铜鼓县| 林州市| 观塘区| 宁强县| 绍兴县| 涡阳县| 玉溪市| 左贡县| 阳春市| 类乌齐县| 巫山县| 临洮县| 盐津县|