Exercise – 13 / How to add Geometry to Attributes in QGIS
The geometry tool is an easy to use tool that allows you to add the following geometry values to points, lines, and polygons:
- Point: The XCOORD and YCOORD columns will contain the x and y coordinates of the point
- Line: The SHAPE_LEN column will contain the length of the record's line(s)
- Polygon: The AREA and PERIMETER columns will contain the area and perimeter of the record's polygon(s).
Add Geometry Attributes for Point.
- Add Point Layer to Layers panel
Figure 134 - Point layer for adding geometry
- Open attribute table
Figure 135 - Attribute table before adding geometry
- Choose Vector → Geometry tools →Add Geometry Attributes
Figure 136 - Add geometry attributes window for Point
- Select input layer (Ex: Ind_Point)
- Select CRS from (Layer CRC / Project CRC / Ellipsoidal), better to select Layer CRS
- Click on Run
- Temporary layer will be created and added to Layer panel with Added geom info layer. Right click on the layer and save to destination folder.
- Open the attribute table to see XCOORD and YCOORD columns added.
Figure 137 - Attribute table after adding geometry
Add Geometry Attributes for Line.
- Add Line Layer to Layers panel and open attribute table
Figure 138 - Line layer with attribute data before adding geometry
- Choose Vector → Geometry tools →Add Geometry Attributes
Figure 139 - Add geometry attributes window for Line
- Select input layer (Ex: Ind_Lines)
- Select CRS from (Layer CRC / Project CRC / Ellipsoidal), better to select Layer CRS
- Click on Run
- Temporary layer will be created and added to Layer panel with Added geom info layer. Right click on the layer and save to destination folder.
- Open the attribute table to see length columns added.
Figure 140 - Line layer with attribute data after adding geometry
Add Geometry Attributes for Polygon.
Add Polygon Layer to Layers panel and open attribute table
Figure 141 - Polygon layer with attribute data before adding geometry
- Choose Vector → Geometry tools →Add Geometry Attributes
Figure 142 - Add geometry attributes window for Polygon
- Select input layer (Ex: Ind_adm1)
- Select CRS from (Layer CRC / Project CRC / Ellipsoidal), better to select Layer CRS
- Click on Run
- Temporary layer will be created and added to Layer panel with Added geom info layer. Right click on the layer and save to destination folder.
- Open the attribute table to see area and perimeter columns added.
Figure 143 - Polygon layer with attribute data after adding geometry
Comments
Post a Comment