[gdal-dev] Updating shapefile "fields" name with ogr2ogr

Paolo Corti pcorti at gmail.com
Wed Jun 20 13:59:12 PDT 2012


On Wed, Jun 20, 2012 at 7:50 PM, Even Rouault
<even.rouault at mines-paris.org> wrote:
>
> ogrinfo CHEMIN.shp -sql "ALTER TABLE CHEMIN RENAME COLUMN prec_alti TO foo"
>

really nice, I was not aware of this.

Another option I have been always using is:
ogr2ogr -sql 'select field1, field2, fieldn, ..., oldname as newname
from input' output.shp input.shp

but this way we need to regenerate the shapefile
best regards
p

-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti


More information about the gdal-dev mailing list