1

I exported the attribute table of a shapefile to Excel (also saved in CSV). And I'm trying to add some columns to the table, then convert the table back to shapefile with the new columns. The shapefile is a network of roads, but I wasn't able to find a columns that contains x/y coordinates or WKT in the attribute table of the original shapefile.

I'm wondering how can I convert this exported and modified attribute table back to shapefile? I don't have ArcGIS so I think I have to use QGIS or other method.

0

3 Answers 3

3

If you have a unique key/ID in your shape and xls (may be UNIFORM_ID), then you can join the shape and xls.

  1. Open your shape file and the xls in QGIS. Open the xls as a vector layer (you have to select all files from the file type list to see xls files), it will be a table without gemometry in QGIS.
  2. Open the properties of the shape file and select the Join tab.
  3. Add a join to the xls table through the UNIFORM_ID
  4. Export the shape file with the joined columns and delete the unnecessary colums or create new column(s) by field calculator and copy the values from the joined columns.
1
  • 1
    It worked perfectly, thank you!
    – orange
    Jul 18, 2020 at 21:04
1

If it does not work with the xls file, convert your excel file to delimited text format (csv), using UTF-8 as encoding. You can load it to QGIS even without having a geometry, only a table with "naked" attributes as a non spatial table:

https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/attribute_table.html#foreword-spatial-and-non-spatial-tables

When you do a table join with the old shapefile (as described by Zoltan), the newly imported attributes will be added to the geometries (features) in the shapefile. Be sure to have a common, unique field in both tables to make the join. If you have already a fid, that is perfect, but any other field is OK if matching features have the same, unique value.

See documentation for joining tables: https://docs.qgis.org/3.10/en/docs/user_manual/working_with_vector/vector_properties.html#joins-properties

1

If your layer is geolocated so you can add the x & y coordinates to your attribute table by just adding the fields $x and $y to the attribute table.

Getting list of coordinates for points in layer using QGIS?

Your Answer

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

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