3

I want to add geometry columns to a shapefile. I use the tool called Export/Add Geometry Columns. The tool automatically creates a new layer with the input layer's attributes and the new geometry columns. In previous versions this tool (very usefully) allowed to add (or update) the columns to the existing shapefile instead of creating a new one. How can this be done in the 2.16 and 2.18 versions? I tried by selecting the curved arrow icon labelled ("Iterate over this layer") but the program crashes ("An error occurred while executing Python code").

6

You could use the field calculator and the expression:

 geom_to_wkt(  $geometry )

For point data you can create X and Y columns and use the field calculator with:

$x

and

$y

Cheers,

| improve this answer | |
  • Just make sure you select the 'Text' field option when creating the new column and the above will work fine – Alvis Jan 10 at 3:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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