QGIS – Add RowID Field

Marketing
Marketing
  • Updated

By David Crowther

QGIS___Add_RowID_Field_-_1.PNG

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.

QGIS___Add_RowID_Field_-_2.PNG

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.

QGIS___Add_RowID_Field_-_3.PNG

Choose the Add AutoIncremental field menu option.

QGIS___Add_RowID_Field_-_4.PNG

The Add AutoIncremental field tool will open.

QGIS___Add_RowID_Field_-_5.PNG

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

QGIS___Add_RowID_Field_-_6.PNG

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.

QGIS___Add_RowID_Field_-_7.PNG

This is a very simple method to add Unique ID fields to your GIS Layers.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.