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

Ricardo Cezar Bonfim Rodrigues rikardocezar at msn.com
Mon Feb 22 16:09:19 EST 2010


Thanks Frank, the gdalbuildvrt seems to be a good option for me. 
One more question. 

A single deted file level 1 takes almost 6 seconds to be loaded here, since I'm worried about processing time I was thinking about generate and save Gtiff's of all my dted files and work direct with them instead of loading deted files. I've made a simple test here with dted level 0 (I'm having problems to save gtiffs from dted's level 1) and it seems to be much faster. Is it a good way to improve processing time? do you have any other idea?

And here is the code to creates tiffs which works for dted level 0, but dont for dted level 1, It compiles, but breaks and and points an internal error in "xstring" code, if does someone see what is wrong, pls let me know.

...

GDALDataset  *poDataset;
GDALAllRegister();

poDataset = (GDALDataset *) GDALOpen( "s20.dt1", GA_ReadOnly );

...

GDALDataset *poDstDS; 
poDstDS = poDriver->CreateCopy( "output.tif", poDataset, FALSE, 
                                    NULL, NULL, NULL );
 
GDALClose(poDstDS);

...

Thanks

Ricardo Rodrigues
Brazil


> Date: Mon, 22 Feb 2010 08:14:49 -0500
> From: warmerdam at pobox.com
> To: rikardocezar at msn.com
> CC: gdal-dev at lists.osgeo.org
> Subject: Re: [gdal-dev] Loading various DTED files in a single block
> 
> 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
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100222/b5600662/attachment.html


More information about the gdal-dev mailing list