[gdal-dev] GDAL Utilities: Keeping output format identical to input format

Zoltan Szecsei zoltans at geograph.co.za
Mon Dec 15 03:44:30 PST 2014


Hi Even,
Thanks for the comment regarding gdal_edit.

Regards,
Zoltan


On 2014/12/15 13:36, Even Rouault wrote:
> Le lundi 15 décembre 2014 12:27:34, Zoltan Szecsei a écrit :
>> On 2014/12/15 12:53, Even Rouault wrote:
>>> See http://www.gdal.org/gdal_edit.html
>> Hi Even,
>> I had a look at gdal_edit but could not get it to work on the server as
>> it is Ubuntu 12.04, so first I need to work out how to fix the gdal
>> installation on there.
>>
>>      *zls at gs0:/mnt/geo_lvm0/gisdata/raster/orthos$* gdalinfo --version
>>      GDAL 1.9.1, released 2012/05/15
>>      *zls at gs0:/mnt/geo_lvm0/gisdata/raster/orthos$* gdal_edit.py --version
>>      Traceback (most recent call last):
>>         File "/usr/bin/gdal_edit.py", line 33, in <module>
>>           from osgeo import gdal
>>         File "/usr/lib/python2.6/dist-packages/osgeo/__init__.py", line
>>      21, in <module>
>>           _gdal = swig_import_helper()
>>         File "/usr/lib/python2.6/dist-packages/osgeo/__init__.py", line
>>      17, in swig_import_helper
>>           _mod = imp.load_module('_gdal', fp, pathname, description)
>>      ImportError: /usr/local/lib/libgdal.so.1: undefined symbol:
>> GEOSSimplify *zls at gs0:/mnt/geo_lvm0/gisdata/raster/orthos$*
> Looks like your GDAL has been compiled against a GEOS version and you run it
> against another (older) one.
> Or you have a mix of GDAL versions.
>
>> I am using the following (instead of gdal_edit) but was wondering if my
>> band pixels were being altered.
> Yes they will as you use a lossy compression.
>
>>      gdal_translate -a_srs +proj="tmerc +lat_0=0 +lon_0=19 +k=1 +x_0=0
>>      +y_0=0 +axis=wsu +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m
>>      +no_defs" -co "COMPRESS=JPEG" -co "PHOTOMETRIC=YCBCR"
>>      3121DA_09_2011_407_RGB_RECT.tif 3121da09.tif
>>
>> Then because the gdal_translate strips out the overviews:
>>
>>        gdaladdo --config COMPRESS_OVERVIEW JPEG --config
>>      PHOTOMETRIC_OVERVIEW YCBCR --config INTERLEAVE_OVERVIEW PIXEL
>>      3121da09.tif 2 4 8 16 32 64 128 256 512
>>
>> So, I was looking at a 1-step way of doing the above, ideally without
>> having to manually peek into an adjoining sheet to get the correct proj.
>> *This is what I am aiming at:*
>> I have about 40000 of these images, and I have written a BASH with awk
>> script  to go through all the images and pull out certain info to build
>> a CSV file so that I can create attributed polygons to have info about
>> the underlying raster image. When this awk script fails to find embedded
>> proj info, it would be nice to make it peek into the adjoining ortho,
>> extract the relevant info, and edit it into the 'bad' ortho.
> gdal_edit is really what you want. Will be much faster than
> gdal_translate+gdaladdo and will not alter pixel values.
>
>> Thanks again for your help.
>> Kind regards,
>> Zoltan


-- 

===========================================
Zoltan Szecsei PrGISc [PGP0031]
Geograph (Pty) Ltd.
GIS and Photogrammetric Services

P.O. Box 7, Muizenberg 7950, South Africa.

Mobile: +27-83-6004028
Fax:    +27-86-6115323     www.geograph.co.za
===========================================



More information about the gdal-dev mailing list