[GIS] Using ECW with mapserver

ecwgdalmapserver

I know that mapserver drop the support for ecw due to licensing issues. But if i understand well, as mapserver rely on GDAL, if GDAL support ECW, mapserver can serve ECW data.

So I've compiled libecwj 3.3 , then compile GDAL. Now GDAL can read ECW.

But in mapserver, ecw data don't work. The error is :

MsDrawMap(): Image handling error. Failed to draw layer named
'ortho'.; MsDrawRasterLayerLow(): Unable to access file. Corrupt,
empty or missing file 'my_file.ecw' for layer 'ortho'.

I tried to recompile mapserver. But with no effect. Does someone know if it's possible and where is the mistake ?

My config is :
– debian 7
– libecwj 3.3
– gdal 1.10.1
– mapserver 6.4.0

Thanks for your help !

Best Answer

After hours of compiling, i found my mistake...

Nothing related to compilation. The problem was my mapfile. I had a layer definition that look like :

MAP
  SHAPEPATH /my/absolute/path
  [...]

  LAYER
    DATA "../my_file.ecw"
    [...]
  END
END

If i give absolute path in layer definition, mapserver work perfectly. It work with shapefile, but not with ecw. My mistake, SHAPEPATH is rather explicit.

Related Question