[Gdal-dev] down sample question

Clay, Bruce bclay at ball.com
Wed Apr 28 10:20:57 EDT 2004


Thanks for the reply Frank.

New question...

Does anyone have a routine to share that given a data set in memory that
performs any form of interpolation to determine the elevation at a
particular latitude and longitude?  I assume this requires interpolation
from the latitude north and south the desired point as well as the
longitude east and west of the desired point.

I understand that GDAL is intended to be used for full arrays but I need
to do this function in a terrain information server so the user can find
the elevation of any specified point from a variety of data files.

As always, thanks for any suggestions or thoughts.

Bruce


-----Original Message-----
From: gdal-dev-admin at remotesensing.org
[mailto:gdal-dev-admin at remotesensing.org] On Behalf Of Frank Warmerdam
Sent: Tuesday, April 27, 2004 9:38 AM
To: gdal-dev at remotesensing.org
Subject: Re: [Gdal-dev] Dither question


Clay, Bruce wrote:
> I see that RasterIO can be used to effectively dither a raster file by

> skipping a certain number of pixels for both x and Y in the call.
> 
> Is there a method to extract data from the band at a specified 
> fraction of a degree spacing?
> 

Bruce,

Arguments tot he RasterIO() call are always pixel/line rectangles.  You
can approximately compute a pixel/line rectangle mapping corresponding
to a particular sampling ratio in degrees but it is up to the
application.

Note, that RasterIO() provides downsampling and upsampling with an
unspecified sampling approach.  In practice it is nearest neighbour
sampling with the exception of when overviews are available, in which
case it is nearest neighbour from the nearest overview of at least the
same resolution as the request.  However, since the overviews can be
generated via other mechanisms (ie. averaging) then final result may not
be quite nearest neighbour.

Also, I am not acustomed to calling generic downsampling dithering.  I
normally think of dithering as a family of techniques used to convert
24bit images to 8bit, often with "error diffusion" or other means to
average out radiometric error.  There is a GDALDitherRGB2PCT() function
available that will apply Floyd-Steinberg error diffusion during
dithering.

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