[Gdal-dev] Need a sanity check on processing imagery

Frank Warmerdam warmerdam at pobox.com
Fri Mar 9 02:18:51 EST 2007

Stephen Woodbridge wrote:
> Hi all,
> I'm getting the utm zone from here and it just dawned on me that I can 
> do something like:  -s_srs naip_1-1_1n_s_ut057_2006_1.prj instead of 
> reading the file myself. Right?


Yes, you can if it is an OGR compatible WKT.  If it is ESRI WKT
then it could possibly fail since these differ in some cases, but
likely it will be fine.

> $ gdalwarp -s_srs +init=epsg:26912 -t_srs EPSG:4326 -te -111.9375 
> 41.4375 -111.875 41.5 -rc -wm 250  -co "TILED=YES" 
> naip_1-1_1n_s_ut057_2006_1.sid B-111_41_129.tif
> Some of the tiles will have to be mosaiced into a common tile from 
> multiple CCM files along their edges. Some of the options above imply 
> that I want a new file and NOT a mosaic. Would that be the -t_srs 
> EPSG:4326 and -co "TILED=YES" options?

I suspect just the -co creation option.

> Does this look like a reasonable process? Or is it flawed?

You are generating files for which the top left corner of the
top left pixel is at the lat/long location -11.9375,41.4375.
Is that want you want?  Sometimes people really want the center
of the top left pixel to be at that point.  If that is what you
want, you will need to manually adjust the extents "out" by a
half pixel.

> Can I do anything to speed this up? make -wm larger?

You could try setting the GDAL_ONE_BIG_READ configuration option
on so that each chunk the warper wants from the mrsid file will
be read in a single gulp, instead of potentially in many small
reads which are quite expensive with MrSID.

eg add "--config GDAL_ONE_BIG_READ ON" to your commandline.

Also, avoiding cubic convolution as the resampling kernel would
also save substantial time, but likely at some cost in degredation
of the resulting image.

> Can I extract multiple file tiles without having to open the file each 
> time? Can that be done in Perl with the Geo::GDAL module?

It could be done by creating a modified form of gdalwarp, but the
warp api isn't well exposed in the various script languages so it
is unlikely that you could do this effectively in perl.  In any
event avoiding the reopening of the mrsid file is unlikely to
save much time in this process since each output tile is a substantial
chunk of work on it's own (5K x 5K).

Good luck,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

More information about the Gdal-dev mailing list