[gdal-dev] Loading various DTED files in a single block

Frank Warmerdam warmerdam at pobox.com
Mon Feb 22 08:14:49 EST 2010


Ricardo Cezar Bonfim Rodrigues wrote:
> Hi everyone,
> 
> I'm writing a code to find highest terrain elevation in dted files.
> I'm already reading the elevations from a dted with gdal. But there
> are cases where the region I'm searching the highest elevation
> contains more then one file (e.g. s20.dt1, s20.dt1 etc...). So I was
> wondering how could I load more than one file in a single pafScanline
> and if would be a good strategy to work with.

Ricardo,

There is no handy function in GDAL for searching a set of GDALDataset's
to find out which ones overlap a particular region.   So you would
pretty much need to do this yourself.  The normal way to do this
might be to open all the files and identify which are overlapping.
However, with special knowledge of the dted tiling scheme and naming
convention you could likely identify the correct files without having
to pre-open any unnecessary files.

Another approach would be to treat all the DTED files as one large
virtual image.  Then you just ask for a region and it will take
care of opening the required files.  To build a virtual raster suitable
for this purpose you can use the gdalbuildvrt program (possibly only
available in recent versions of GDAL).

 >  I have also read about
> GDAL_DTED_SINGLE_BLOCK=TRUE, but where I set it? is it for a single
> file?

This only affects whether a DTED file is treated as a single block
or with one block per column.  I don't see it as being relavent to
your purpose.

Best regards,
-- 
---------------------------------------+--------------------------------------
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    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list