Rép. : [ms4w-users] WMS format question

SIMON MERCIER simon.mercier at msp.gouv.qc.ca
Tue Dec 4 23:41:59 EST 2007


Hi michael  
ArcGIS always make the WMS GetMap request in png image format... I think theres no workaround in arcgis...! and mapserver surpport this output format by default ..but in a 8-bit format...

OUTPUTFORMAT
  NAME png
  DRIVER "GD/PNG"
  MIMETYPE "image/png"
  IMAGEMODE PC256  # -- 8-bit
  EXTENSION "png"
END

so... maybe you can try to overwrite this format with 2 OUTPUTFORMAT in your mapfile ...!
...
OUTPUTFORMAT
  NAME png
  DRIVER "GD/PNG"
  MIMETYPE "image/png"
  IMAGEMODE RGB  # --> 24-bit or png24 or RGBA for transparency use ... 
  EXTENSION "png"
END
#and
OUTPUTFORMAT
  NAME jpeg
  DRIVER "GD/JPEG"
  IMAGEMODE RGB
  EXTENSION "jpeg"
  FORMATOPTION "QUALITY=75,PROGRESSIVE=TRUE"
END
...


OR ... you can try to add this in your orthos image layer ... but not sure
PROCESSING "DITHER=YES"

more info look the raster data access page of f.wamerdam 
http://mapserver.gis.umn.edu/docs/howto/raster_data
 ..good luck



Simon Mercier
Analyste en Géomatique
Service de l'infrastructure et du réseau
Direction des technologies de l'information
Ministère de la Sécurité publique 
2525, boul. Laurier, 10e étage
Québec (Québec) G1V 2L2
Téléphone : 418 646-5687
Fax: 418-643-0787

>>> "Smith, Michael" <Michael.Smith at maine.gov> 04/12/07 16:37 >>>
Greetings,

I am a newbie to MapServer and WMS, but an old ESRI hand.  I have
MapServer (MS4W) running with ka-Map on a Windows XP PC.  I have created
a simple MapServer .map file which works fine in ka-Map.  Since it is
based on raster data (MrSID file which is 24-bit NAIP 2007 orthophoto
mosaic), I set the output format to JPEG.  This works fine in ka-Map and
looks the way I want it.  However, when I add this WMS to ArcMap, it
appears to make 8-bit files.

I can see in my temp folders that indeed, the ka-Map output is JPEG like
I want, but the ArcMap output is PNG.  The JPEGs are nice 24-bit images
and the PNGs 8-bit garbage.

Any suggestions?  My .map file is below.  Looking at web resources, it
seems like I need a "wms_format" "img/jpeg" somewhere, but after many
permutations of those parameters in my map file, I still can't seem to
get jpegs in ArcGIS, only PNGs.


***********
Michael Smith
Maine DEP/OIT 

#
# Start of GMAP map file
#
#
NAME GMAP_DEMO
STATUS ON
SIZE 400 300
SYMBOLSET ../etc/symbols.sym
EXTENT 413000 4837000 446000 4894000
UNITS METERS
SHAPEPATH "../medata"
IMAGECOLOR 255 255 255
FONTSET ../etc/fonts.txt

OUTPUTFORMAT
  NAME jpeg
  DRIVER "GD/JPEG"
  IMAGEMODE RGB
  EXTENSION "jpeg"
  FORMATOPTION "QUALITY=75,PROGRESSIVE=TRUE"
END

#
# Start of web interface definition
#
WEB
#  Scales commented out for WMS
#  MINSCALE 5000
#  MAXSCALE 350000
#
# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the
root 
# of the drive where the .MAP file resides.
#
  IMAGEPATH "/ms4w/tmp/ms_tmp/" 
  IMAGEURL "/ms_tmp/"
# For WMS
  METADATA
    "wms_title" "wms_demo"
	"wms_onlineresource"
"http://csu-eia1pcgis2.som.w2k.state.me.us/cgi-bin/mapserv.exe?map=c:/ms
4w/apps/gmap/htdocs/gmap75.map&"
	"wms_srs" "EPSG:26919"
  END
END

#
# Projection - required for WMS
#
PROJECTION
  "init=epsg:26919"
END

#
# Start of reference map
#
REFERENCE
   IMAGE meimages/keymap.png
   EXTENT 413000 4837000 446000 4894000
   STATUS ON
  COLOR -1 -1 -1
  OUTLINECOLOR 255 0 0
  SIZE 116 116
END

#
# Start of legend
#
LEGEND
  KEYSIZE 18 12
  LABEL
    TYPE BITMAP
    SIZE MEDIUM
    COLOR 0 0 89
  END
  STATUS ON
END

#
# Start of scalebar
#
SCALEBAR
  IMAGECOLOR 255 255 255
  LABEL
    COLOR 0 0 0 
    SIZE SMALL
  END
  SIZE 150 5
  COLOR 255 255 255
  BACKGROUNDCOLOR 0 0 0
  OUTLINECOLOR 0 0 0
  UNITS kilometers
  INTERVALS 5
  STATUS ON
END


QUERYMAP
  STYLE HILITE
  COLOR 255 0 0
END


#
# Start of layer definitions
#


LAYER
  NAME naip2007
  METADATA
    "wms_title" "NAIP 2007"
  END
  TYPE RASTER
  STATUS ON
  DATA sagadahoc.sid
  PROJECTION
    "init=epsg:26919"
  END
END

END # Map File

_______________________________________________
ms4w-users mailing list
ms4w-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/ms4w-users




More information about the ms4w-users mailing list