[FWTools] gdal JPEG2000 driver and shp2img , MapServer

Frank Warmerdam warmerdam at pobox.com
Thu Feb 17 10:19:34 EST 2011

On 11-02-17 02:55 AM, karsten vennemann wrote:
> I am trying to create a huge map in JPEG2000 format using shp2img or MapServer.
> On the machine I am using (a windows laptop winxp serv pack 3) I have multiple
> version of gdal (FWTools, OSGEO4W and MS4W´).
> The version of gdal_translate that comes with the FWTools ( version 2.4.6)
> lists that the gdal driver for JPEG2000 is available. However, when I am trying
> to use a map file to reference 2 layers:
> 1. massive sized hillshade in JPEG2000 format (1.1 GB big)
> 2. satellite imagery from NASA Bluemarble (400 MB file size as TIFF)
> The final composite map output has to be a high resolution image (yes just one)
> in 300 dpi ... and I will need it in JPEG2000 format because that output will
> result to be about 500 MB big...
> However when I try to use shp2imgfrom the FWTools\bin directory
> or MapServer directly with query string) then I get an error message saying
> that shp2img or MapServer have no such JP2ECW (which is the jpeg 2000) driver
> available ...
> Ithis somehow a path issue ? - such that shp2img.exe or mapserv.exe will not
> use the correct version of gdal drivers (and instead another gdal lib hat does
> not have the drivers)?
> Any ideas what I can do to fix this ?


I'm not sure why the FWTools MapServer is not finding the JP2ECW driver if
you have it with gdalinfo.  However, your project isn't going to work the way
you want anyway.  There is no way to assemble a single map in memory to large
that it will be 500MB when jpeg2000 compressed.  You are going to need to come
up with a scheme to produce the final result in chunks with MapServer and
then assemble them into a final product as a post processing step.

Note that the JP2ECW driver only supports writing large JPEG2000 files if
you set the LARGE_OK creation option on, and you are required to have a valid
license to do so.  So I also don't think you ought to be using the JP2ECW
driver to assemble your final jpeg2000 product.

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 FWTools mailing list