MrSID mapserver vs gdal_translate
Simpson
asimpson at I-55.COM
Fri Sep 10 07:47:04 PDT 2004
Hi,
I find gdal_translate about three times faster than mapserver when
processing a small area from a MrSID file. If I add a class definition to
the layer in the map file, the results are black and white, but the image
renders at about the same speed as gdal_translate. Is this disparity in
time a result of bands being extracted separately?
Thanks for any help,
Drew.
GDAL_TRANSLATE RUN
# time gdal_translate -of png -outsize 600 600 -projwin 237197.849522
3385281 >
Input file size is 47637, 39167
Computed -srcwin 5376 34431 1251 1252 from projected window.
20.05s real 17.87s user 2.15s system
MAPSCRIPT RUN
# time ./ms_mrsid.cgi
Generating map...
[Fri Sep 10 09:14:12 2004].218670 msDrawRasterLayerLow(dynraster):
entering.
[Fri Sep 10 09:14:12 2004].225859 msDrawGDAL(): red,green,blue,alpha
bands = 1,2,3,0
Map done. Output in ./1094825652.mp.png
65.13s real 58.31s user 6.28s system
MAPSERVER VERSION
MapServer version 4.0.1 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
SUPPORTS=PROJ SUPPORTS=FREETYPE
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT INPUT=TIFF
INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
GDAL_VERSION
1.2.1
OS
Linux xxx 2.4.20-28.8 #1 Thu Dec 18 12:53:39 EST 2003 i686 i686 i386
GNU/Linux
IMAGERY
Landsat data from https://zulu.ssc.nasa.gov/mrsid/
Specifically
https://zulu.ssc.nasa.gov/mrsid/bin/download_file.pl?client=etmpsmos/sid&ima
ge=N-16-30_2000.tar (may take multiple attempts to download)
MAP FILE
NAME DEMO
STATUS ON
SIZE 600 600
EXTENT 237197.849522 3367440.634804 255029.015690 3385281.561774
UNITS meters
SHAPEPATH "data"
IMAGECOLOR 255 255 255
DEBUG ON
IMAGETYPE png_rgb
OUTPUTFORMAT
NAME png_rgb
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
END
WEB
IMAGEPATH "set in demo_init.html"
IMAGEURL "set in demo_init.html"
LOG "/home/asimpson/wms/mapserver.log"
END
LAYER
NAME dynraster
TYPE RASTER
MAXSCALE 6000000000
STATUS DEFAULT
DEBUG ON
DATA "/home/asimpson/wms/data/n_16_30_2000c.zu.sid"
#CLASS
# NAME "dynraster"
#END
END
END # Map File
MAPSCRIPT
#!/usr/bin/perl
use strict;
use mapscript;
$| = 1;
my $time = time;
my $tmp_base = $time;
my $scratch = "./";
my $mapfile = "./ms_mrsid.map";
GenerateMap();
exit;
#################################################
sub GenerateMap
{
my($map,$img,$map_file,$layer);
my($numlayers,$l);
print "Generating map...\n";
$ENV{MS_ERRORFILE} = './mapserver.log';
$map = new mapscript::mapObj($mapfile) || die
$mapscript::ms_error->{code}.": ".$mapscript::ms_error->{message};
$img = $map->draw() or die "Unable to render
map.".$mapscript::ms_error->{message};
$map_file = "$time.mp.png";
$img->save($scratch.$map_file);
print "Map done. Output in $scratch$map_file\n";
}
More information about the MapServer-users
mailing list