[Gdal-dev] RasterIO() speed
Gerald Brandt
gbr at MICROPILOT.com
Fri Jun 4 16:40:33 EDT 2004
Subsequent requests for elevation information from the same file is
quick. Memory usage of my app jumps from 3.5 MB to about 119 MB though.
Thanks for the quick help!
Gerald
> -----Original Message-----
> From: gdal-dev-admin at remotesensing.org
> [mailto:gdal-dev-admin at remotesensing.org] On Behalf Of Frank Warmerdam
> Sent: Friday, June 04, 2004 3:24 PM
> To: gdal-dev at remotesensing.org
> 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