By David Crowther
Question:
How can you add a RowID Field to a layer within QGIS?
Answer:
The Add AutoIncremental Field Tool allows you to update your GIS files with a new column with an incremental value that can then be used as a row/unique id value.
In QGIS below we have a Point Layer representing some School locations.
We would like to add a new field to this layer with a Unique ID value.
From the Processing menu choose > Toolbox > and open the Vector Table section.
Choose the Add AutoIncremental field menu option.
The Add AutoIncremental field tool will open.
We will use the following settings:
- In the Input Layer choose - the Schools Layer
- In the Field name change the field to be created to be called – rowid
- Change the Start values at option to start at - 1
If you Run the Add AutoIncremental field tool, it will create a Temporary Layer, which is a copy of the input layer (Schools) now with a new field added called – rowid - where there are numeric values for each record.
If you Open the Attributes Table for the new Temporary Layer (called Incremental) you can see the new rowid values.
This is a very simple method to add Unique ID fields to your GIS Layers.
Comments (0 comments)