[Gdal-dev] RasterIO() speed
Chris G. Nicholas
cgn at globexplorer.com
Sat Jun 5 13:59:11 EDT 2004
If folks are seriously psyched (or psycho...) they might consider using readv(2) and writev(2) to different offsets in the source and target buffers...
Chris
-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com]
Sent: Fri 6/4/2004 1:24 PM
To: gdal-dev at remotesensing.org
Cc:
Subject: Re: [Gdal-dev] RasterIO() speed
Gerald Brandt wrote:
> Hi,
>
> I have a loaded DEM file (USGSDEM/USGS Optional ASCII DEM) of Lake
> Tahoe. It's size is 3516 x 8430 x 1.
>
> My command is
>
> dataset->GetRasterBand(1)->RasterIO(GF_Read, xpixel, yline, 1, 1,
> &elevation, 1, 1, GDT_Float64, 0, 0) ;
>
> With and xpixel value of 329 and a yline value of 4199.
>
> The RasterIO() call takes 340 seconds on a Pentium 4 2.8 GHz
> hyper-threaded system. The cpu sits between 17% and 25% while in the
> call. Is this normal, and if so, is there a way that I can speed up the
> process other than caching the elevation in my own array for every point
> in the grid?
Gerald,
This is an unusually large USGS DEM ASCII file. I gather this is not a
standard product?
The USGS DEM driver (unlike most other drivers) just reads the whole
file into memory. I think it is cached, so subsequent reads should
be essentially instant. If not, just read the whole file into memory and
close the file then access the data from your memory array.
For most formats GDAL only loads parts of the file as needed and endevours
to avoid using too much memory. USGS DEM is an exception.
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
_______________________________________________
Gdal-dev mailing list
Gdal-dev at remotesensing.org
http://remotesensing.org/mailman/listinfo/gdal-dev
More information about the Gdal-dev
mailing list