non-tiff (24 bit?) raster layers in 4.10

Rahkonen Jukka Jukka.Rahkonen at MMMTIKE.FI
Wed May 9 12:06:53 EDT 2007


From: UMN MapServer Users List on behalf of Attila Csipa
Sent: Wed 9.5.2007 17:29
 
>On Wednesday 09 May 2007 08:00, Rahkonen Jukka wrote:
>> can all the drivers handle compressed jpeg2000 in an effective way. You'll
>> have something to compare with if you browse your images with kdu_show
>> browser. Just as an example, here is a parameter set for kdu_compress that
>> should result in pretty fast browseable, in this case lossless jpeg2000
>>
>> kdu_compress -i infile.tif -o outfile.jp2 -rate - Clevels=7 Clayers=20
>> Creversible=yes Cycc=no Cprecincts={256,256},{128,128} Corder=RPCL
>> Cblk={32,32} ORGgen_plt=yes ORGgen_tlm=8 ORGtparts=R -cpu 0 -mem

>I did play around with Clayers and Clevels, I originally missed Corder, 
>retried now with it but it had no apparent impact on .jp2 performance under 
>Mapserver :( This is what I get with a single layer, with just one tile in it 
>(zoomed out to around a 100x100 pix resulting tile in the image).

>time shp2img -m jp2test.map -o /tmp/aaa.png
>GDAL: GDALClose()

>JPEG2000: IHDR box found. Dump: width=5000, height=5000, numcmpts=3, bpp=8
>JPEG2000: Component 0: bpp=8, signedness=0
>JPEG2000: Component 1: bpp=8, signedness=0
>JPEG2000: Component 2: bpp=8, signedness=0
>GDAL: GDALOpen(/ortofoto/75790_48000.jp2) succeeds as JPEG2000.

>GDAL: GDALClose(/ortofoto/75790_48000.jp2)

>GDAL: GDALDeregister_GTiff() called.
>real    1m9.276s
>user    0m33.546s
>sys     0m3.524s

>So it seems to me no overviews or similar format inherent options were 
>actually used. The odd thing is that mapserver/gdal/jasper/whoever spent half 
>of the time outside of userspace, possibly mucking around on the disk 
>(the .jp2 file itself is ~16MB).

I did some time ago a quick comparison about Mapserver speed with GeoTIFF, ECW, and jpeg2000 with JP2ECW and JP2KAK drivers.   Then GeoTIFF was, not surprisingly, the fastest followed by ECW and jpeg2000 with JP2ECW (ER Mapper) driver.  Jpeg2000 with Kakadu driver was slowest of those at that time.  I have read that GDAL Kakadu driver has been updated a few weeks ago and is a lot faster now. Jasper jpeg2000 driver I have never tried.  You must not accept the speed you are feeling now.  Mapserver can for sure show that little jpeg2000 image in less than two seconds instead of two minutes.  If you wish I can set up a WMS service for you so you have something to compare with. Just send me a personal email about that, my home ADSL connection is too slow for the whole mailing list.

>Unfortunately I don't have kdu_show at hand (no windows boxen on the site :
>( ), but using kdu_render it DOES go much, much faster (takes less than 10 
>sec for rendering the whole 5000x5000 file into a bmp).

>> Sorry, but I did not understand this part totally, could you clarify a bit?
>
>> >kde_compress only kept the first image if there were multiple no
>> >matter what I did

>for example 'identify 75790_48000_i.tif' gives:
>75790_48000_i.tif[0] TIFF 5000x5000 DirectClass 78.3mb 0.700u 0:11
>75790_48000_i.tif[1] TIFF 2500x2500 DirectClass 78.3mb 0.380u 0:09
>75790_48000_i.tif[2] TIFF 1250x1250 DirectClass 78.3mb 0.070u 0:03
>75790_48000_i.tif[3] TIFF 625x625 DirectClass 78.3mb
>75790_48000_i.tif[4] TIFF 313x313 DirectClass 78.3mb

>since tif is a container format. The trouble is that the other images are not 
>necessarily overviews, they can be specific thumbnails, etc. When I do a 
>kdu_compress on such a file, the result will be a _single_ JPC image in the 
>tif. There might of course be a magic option for it in the jungle of 
>kakadu/jp2 options, but have not run across it.

You cannot do that directly with Kakadu demo software.  Kakadu is after all software development kit, even if it does offer some ready made executables.  However, if you explode your existing tiffs first into 1-channel or 3-channel tiffs you can compress them all together into multichannel jp2 file (from greyscales) or alternatively to .jpx file which can contain almost anything you can imagine.  However, I haven't been able to use my own jpx images for anything really useful yet  because not many software support jpx files which contain several codestreams.

If you would like to save a lot of disk space without loosing more than 50% of speed with Mapserver I would recommend you to try ECW format.  By the way, ER Mapper ECW compressor is also a fast jpeg2000 compressor and it does not give too many dazzling options for the user.

Regards,

-Jukka Rahkonen-



More information about the mapserver-users mailing list