Tiled JPEG-2000 layer

Chris Hodgson chodgson at REFRACTIONS.NET
Wed Sep 22 14:43:52 EDT 2004


I'm trying to setup mapserver to show a tiled set of jpeg-2000 images. I
created the images from tif/wld file pairs using commands like this:

gdal_translate -of JPEG2000 -co "rate=0.1" 92g021_1_alb.tif
92g021_1_alb.jp2

The original files were around 180MB each and they compress to %10 of te
original size (as per the specified rate). Then I try to build a tile
index for mapserver using:

gdaltindex jp2_tiles *.jp2

and the resulting jp2_tiles.shp file is corrupt in some way - crashes
ArcMap9 and causes JUMP to throw an IndexOutOfBoundsException. It does
open in Arcview3, however. I'm not sure if this was a problem for
mapserver, but just to make sure I built the tileindex on the tiff files
and then did a search/replace in the dbf file (ie. s/\.tif/.dbf/g ).

When I try to look at the layer, even when zoomed in to just a single
tile, the mapserver process sucks up 2Gigs of memory and 100% cpu for
several minutes before it finally returns the resulting image - and
sometimes it doesn't display an image at all (perhaps it times out?).

My layer definition looks like this:

  LAYER
    NAME "orthophoto_jp2"
    METADATA
      "wms_title" "orthophoto_jp2"
    END
    STATUS ON
    TILEINDEX "jp2_tiles.shp"
    TILEITEM "Location"
    TYPE RASTER
    PROJECTION
      "init=epsg:42102"
    END
  END

I'm not reprojecting the data, I'm asking for it in the same epsg it is
declared to be in.
I'm using a very recently downloaded and compiled:

- MapServer version 4.2.3 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
INPUT=EPPL7 INPUT=POSTGIS INPUT=GDAL INPUT=SHAPEFILE
- GDAL 1.2.1.0, released 2004/06/23
- ftp://ftp.remotesensing.org/gdal/jasper-1.701.0.uuid.tar.gz

One more detail, my original tif files have had several overview layers
added using gdaladdo - I don't think that should affect anything but who
knows.

Am I doing something wrong here, or is there a know problem with this
setup? I don't expect that a dual-3GHz CPU/2GB memory machine should
take so long and so much memory to open a shapefile, locate the correct
jp2 file(s) and open and render them...

Chris



More information about the mapserver-users mailing list