Monday, 27 March 2017

QGis Making Column Value of Attribute table unique


For a shapefile, I have a field named id with the following contents in it:


1
1

2
2

I want to make these values unique such as:


1
2
3
4

Is there any way to achieve this in Quantum GIS (using any plugin or other means) ?




Answer



You can use the Field Calculator in the Attribute table to assign the features unique values by checking "Update existing field", selecting the appropriate field, and entering $rownum in the Expression box. This will assign each feature its row number as its ID.


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...