Opened 20 years ago

Closed 20 years ago

#691 closed defect (fixed)

drawERD() interferes with GDAL's .lan format support

Reported by: dmorissette Owned by: dmorissette
Priority: high Milestone:
Component: GDAL Support Version: 4.2
Severity: normal Keywords:
Cc:

Description

Support has been added recently in GDAL for ERDAS .LAN files.  Unfortunately we
can't use it because the drawERD() function tries to process the file (and
crashes) before we get to the GDAL code in mapraster.c.

The temporary workaround is to #ifndef USE_GDAL arounf the call to drawERD(),
but that's probably not a good long term solution. Is drawERD() useful when GDAL
is available? Is it safe to #ifndef USE_GDAL around that block?  Should this be
made a configure option which is disabled by default when GDAL is enabled, much
like the native tiff support?

Here is the block of code from mapraster.c that had to be #ifndef'd:


#ifndef USE_GDAL
    if (memcmp(dd,"HEAD",4)==0) {
      if(layer->transform && msProjectionsDiffer(&(map->projection),
&(layer->projection))) {
        msSetError(MS_MISCERR, "Raster reprojection supported only with the GDAL
library, but it does not support Erdas 7.x files.", "msDrawRasterLayer( ERD )");
        return(MS_FAILURE);
      }
      status = drawERD(map, layer, img, filename);
      if(status == -1) {
            return(MS_FAILURE);
      }
      continue;
    }
#endif

Change History (4)

comment:1 by sdlime, 20 years ago

My opinion would be to ditch the internal .lan support altogether... Leave the 
eppl support though...

Steve

comment:2 by dmorissette, 20 years ago

Cc: warmerdam@… added; morissette@… removed
Owner: changed from fwarmerdam to morissette@…
OK then... if there are no objections then I will do the following:

- Add the #ifndef USE_GDAL in the 4.2 branch to be included in the 4.2.1 release
(I'd like to keep changes to a minimum in that branch).

- Remove drawERD() completely in the 4.3 branch.

comment:3 by fwarmerdam, 20 years ago

Daniel, 

I concur.  I have removed drawERD() from 4.3, and also implemente support
in GDAL's LAN driver for the .TRL (trailer colormap file) which I see was
supported by drawERD(). 

I haven't #ifdef'ed things in the 4.2 branch ... I'll leave that to you.

comment:4 by dmorissette, 20 years ago

Resolution: fixed
Status: newclosed
#ifndef'd drawERD() in branch-4-2 (to be released as 4.2.1).

Marking Fixed.
Note: See TracTickets for help on using tickets.