12

I need to rename several attributes/fields in a GeoPackage layer. How to do this?

There are numerous pages on how to rename the attributes/fields of a shapefile. However, there do not seem to be any pages specifically addressing the modification of attributes to GeoPackage layers, except a few about using Python scripts. Perhaps what is assumed at the moment (Feb 2019) is that you must be able to do Python programming in order to modify fields in GeoPackage layers.

Before tagging this as a duplicate, please make sure you are not presuming that I am trying to modify a shapefile. I am trying to modify a GeoPackage layer.

1
  • Which methods for renaming fields in a shapefile don't also work on a geopackage?
    – csk
    Commented Feb 19, 2019 at 20:45

2 Answers 2

12

You can rename, drop, add, reorder Geopackage fields using QGis 3.x as follows: Processing > Toolbox > Vector table > Refactor fields. This will output a new Geopackage.

2
  • Ah, fabulous! Toolbox > Vector Table > Refactor Fields. Not only can I rename the fields here, I can also change the data type! And it looks like it can output the new layer within the same Geopackage. That is very different from the methods I have seen for modifying shapefile DBFs. I am so glad it is a built-in tool! Commented Feb 20, 2019 at 23:05
  • @klewis But what if I want to change the name of the geometry column? Commented Sep 16, 2020 at 13:00
3

It's possible to rename attributes/fields in place of a GeoPackage via the Fields tab under Layer Properties.

  1. Double-click the layer in the Layers panel to open Layer Properties
  2. Navigate to the Fields tab on the left.
  3. Enable editing with the pencil icon
  4. Double-click the field name you want to change and hit enter to confirm
  5. Disable editing by clicking the pencil icon again
  6. Apply changes

enter image description here

I've been refactoring layers and overwriting files like a sucker! This way is far less handling. I can't confirm which other file types this process works for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.