Sunday, 14 October 2018

shapefile - Length of Feature



I have a shapefile which renders a map.


I want to calculate and preferably store length of each feature in the shapefile either using QGis or through programmatic means.


What is the best way to get this task done?



Answer



Create a Real Number field in the shapefile. From Attribute table, open 'Field Calculator'. From the functions list, expand 'Geometry' section. selection length.


The expression would look


 $length 

Check update existing field at the top of field calculator and select the newly created double field name.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...