[Gdal-dev] Dataset questions

Frank Warmerdam warmerdam at pobox.com
Thu Sep 29 17:20:09 EDT 2005


On 9/29/05, Ray Gardener <rayg at daylongraphics.com> wrote:
> My apologies if these issues are covered in a FAQ somewhere. I looked
> but couldn't find anything related.
>
> I was wondering how to identify elevation rasterbands -- should I
> just iterate through all the channels available in a file, and
> treat the first one to return CV_Undefined for
> CGDALRasterBand::GetColorInterpretation() as the elevation block? I
> could ask the user which band (in a multichannel file) to load, but want
> the app to automatically handle cases where only a single elevation
> channel exists.
>
> CGDALRasterBand::GetRasterDataType() returns the pixel
> datatype such as int vs. float, but I was wondering if there
> was a method to return the band's meaning, like elevation vs.
> color vs. mask etc.

Ray,

In general you would need to ask the user which is an elevation
band, as from many file formats it is impossible for me to know if
the data is elevation or something else.   Even for formats where I
do know (such as DEM formats!) I don't have any real way for an
application to determine it.

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