0

I have a MultiPolygon shapefile and the attribute table looks like this.

enter image description here

The district names and state names are jumbled with special characters. I know I can use the replace function in the Field Calculator to rectify this but I have to change some of the names altogether.

So to make the editing easier I exported the layer as a CSV file and made the necessary modifications in Excel. Now I cannot import the CSV file again as a shapefile.

Since there is no x,y coordinate information, I tried the below option in add CSV layer (tried both shape_length and shape_area in the geometry field), but it is not working.

enter image description here

6
  • 3
    gis.stackexchange.com/a/186602/238751 might be related.
    – wildkoala
    Commented May 19 at 9:24
  • The link provided is with reference to joining a CSV file to a shapefile. I am aware of that procedure. What I want to know is, I am having a shapefile that needs extensive editing of the attributes which necessitates the use of Excel. In this case after editing it in Excel I want to import the entire CSV file as a MultiPolygon shapefile and not some few columns that can be done with join function. Commented May 19 at 13:20
  • 2
    The geometry data does not, and cannot live in the dBase component. Editing a shapefile's dBase file with Excel is a recipe for disaster. Without knowing each of the dozens of ways you could destroy the shapefile integrity, you should not attempt it. The solution to this antipattern is to use a join, then calculate changed values across using GIS software, which won't destroy the dataset.
    – Vince
    Commented May 19 at 14:23
  • 1
    @Vince did not understand right what you want to do. When you export the polygon shapefile into CSV you must select from "layer options" GEOMETRY=AS_WKT. By default geometries are not saved into CSV. Shape_area and shape_length do not contain geometries. See more info about AS_WKT option from gdal.org/drivers/vector/csv.html. When you have the geometries as WKT in the CSV file you can also import them back.
    – user30184
    Commented May 19 at 15:16
  • 3
    However, the right way to fix your issue would be to read the shapefile with correct character encoding.
    – user30184
    Commented May 19 at 15:23

0