[mapguide-users] MrSID files through GDAL FDO provider

Frank Warmerdam warmerdam at pobox.com
Thu Jun 14 13:03:21 EDT 2007


Kenneth, GEOGRAF A/S wrote:
> The current problem is the Open() call, which tests the providers in turn.
> If there was a file in the folder (say "GDAL Loader Hints.txt" stating ea.:
> MrSID
> ECW

Kenneth,

You state that the "current problem is the Open() call, which tests the
providers in turn.".  What basis do you have to think this is a problem?

I would stress that this is the same mechanism GDAL has used for eight
years, and has been the basis of the raster rendering in MapServer which
is widely accepted as "fast".

For instance, this is the first code in ECWDataset::Open():

     if( EQUALN(poOpenInfo->pszFilename,"J2K_SUBFILE:",12) )
         return Open( poOpenInfo );

     else if( poOpenInfo->nHeaderBytes >= 16
         && (memcmp( poOpenInfo->pabyHeader, jpc_header,
                     sizeof(jpc_header) ) == 0
             || memcmp( poOpenInfo->pabyHeader, jp2_header,
                     sizeof(jp2_header) ) == 0) )
         return Open( poOpenInfo );

     else
         return NULL;

Basically, a string comparison, and then one or two comparisons of
a few bytes of the file header (pre-read and reused for each driver).
This is *fast*.  There are *real* opportunities for optimization out
there.  This is not one of them.

OK, rather than drag this out, I'm going to stop responding to this
thread.

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    | President OSGeo, http://osgeo.org



More information about the mapguide-users mailing list