- QGIS 2 Cookbook
- Alex Mandel Víctor Olaya Ferrero Anita Graser Alexander Bruy
- 309字
- 2021-07-16 11:12:37
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:
- Right-click on the layer name in the table of contents and select Save as....
- 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.
- 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. - 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:
- In the Save as dialog, for raster layers, you can find a CRS field with a Browse button.
- Click on it to open the CRS selector, and select the destination CRS.
- When you click on OK, the raster layer will be exported using the selected CRS instead of its original one.
- UI圖標創(chuàng)意設計
- Unity Virtual Reality Projects
- Building a Recommendation Engine with Scala
- Windows Server 2012 Unified Remote Access Planning and Deployment
- Java面向對象程序設計
- 細說Python編程:從入門到科學計算
- 代碼閱讀
- 零基礎學C語言(升級版)
- 大學計算機基礎實訓教程
- Java高并發(fā)編程詳解:深入理解并發(fā)核心庫
- Xamarin Cross-Platform Development Cookbook
- Spark技術內(nèi)幕:深入解析Spark內(nèi)核架構設計與實現(xiàn)原理
- Yii2 By Example
- SQL Server 2008實用教程(第3版)
- SQL Server 2014 Development Essentials