[gdal-dev] change the attribute values of a shapefile
Etienne Tourigny
etourigny.dev at gmail.com
Thu Feb 2 16:01:13 EST 2012
You can use valrepl.py script to make a copy of your image with new values.
http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/val_repl.py
Or if you really want to edit the shapefile afterwards, try out the
OGR python bindings, but you would need to write your script.
Etienne
On Thu, Feb 2, 2012 at 6:48 PM, Xiaodong Zhang <zhang at liberasystems.com> wrote:
> Hi,
>
>
>
> I’m just wondering if any of you has done and would like to share your
> experience in replacing the attribute values of a shape file.
>
>
>
> Here is what I’m doing:
>
>
>
> 1. I have an image with pixels values ranging from, say, 1, 2, 3 and
> 4
>
> 2. I used gdal_polygonize.py to convert this into a polygone shape
> file, with attributes of 1, 2, 3 or 4.
>
> 3. Now I need to replace these attributes with a set new values, say,
> 10, 20, 30, and 40.
>
>
>
> Of course, I can do this in the first step, but I’m thinking the best way to
> do this is in the last step, because I can preserve the original image. Any
> suggestions?
>
>
>
> Thanks
>
>
>
> Xiaodong
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
More information about the gdal-dev
mailing list