[Gdal-dev] Re: MapServer WCS

Frank Warmerdam warmerdam at pobox.com
Tue Oct 19 09:22:01 EDT 2004


Martin Daly wrote:
> What I would like to do is support these files (and some other more
> esoteric TIFFs) using the GDAL Plug-in for SIS.  But I'd like to keep
> our current internal support as well, for backward compatibility and
> other reasons.  SIS offers files to Plug-ins before attempting to use
> them itself, so what I'd like to be able to do is allow the GDAL Plug-in
> to determine whether or not to accept the file.
> 
> All of which is a long-winded way of saying, what do you think about
> giving public access to the GTiffDataset hTIFF member (it is currently
> private)?  This way I could interrogate the underlying TIFF file to see
> if it was, for example, PLANARCONFIG_SEPERATE.  My nuclear alternative
> is to use libtiff directly, but I'd end up having to open the file using
> GDAL as well just to check that GDAL was happy with it.

Martin,

Well, an extra TIFFOpen() isn't that expensive; however, it happens there is
a very nice mechanism for handling this.  The GDALDataset class has a
GetInternalHandle() method specifically intended to make it possible to
get internal access handles for "extended access" by applications with very
specific needs.  I have added an implementation for the GTiffDataset that
returns hTIFF.

void *GTiffDataset::GetInternalHandle( const char * pszHandleName )

{
     return hTIFF;
}

To future proof you code I would encourage you to pass the handle name
"hTIFF".

Does this give you what you need?

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