[mapserver-users] I need ur help (plz urgent)

Steve Lime Steve.Lime at dnr.state.mn.us
Tue Dec 2 06:48:01 PST 2008


Ques 1: Not sure how you get the regex error with [map]. That tag goes in
the html template (e.g. <input type=hidden name=map map="[map]">) but
note that it will only work IF you are setting "map" on the original call to
MapServer. 

Ques 2: SAVEMAP is not switchable, you'd have to edit mapserv.c and recompile.

Steve

>>> "Amiya Patra" <amiyapatra188 at gmail.com> 12/02/08 12:30 AM >>>
Hello..

    I am new to Mapserver. I have some raster files(tiff). I cant place the
symbol within the created image. But legend is created. Somewhere I read
that raster layer does not support Symbol. And also [map] tag is not working
within HTML template. Error message is msEvalRegex(): Regular expression
error. String ([map]) failed expression test. .I got that SAVEMAP must be
switched on..But how ? I tried to send it via HTML hidden field but I did
not get.
Also if I write PROCESSING "BANDs=1 2 3" then error message is like
msDrawMap(): Image handling error. Failed to draw layer named 'modis'.
drawGDAL(): Unable to access file. Attempt to classify 24bit image, this is
unsupported. I got that by default output image is 8 bit. So I tried to
delare Imagetype JPEG and also Proceesing dither =yes and also via  output
object .But ?? If I commented that line then image quality is very very bad.
And also I need MYSQL connection with raster file notes.


Please I need ur help........And I hope I will get response very soon......
Thank you.











MAP
  IMAGETYPE      JPEG
  EXTENT       0.0 0.0 583.0 421.0   # -179.133392 17.674692 179.788208
71.398048  #           # 0.004349 0.006191 312.987904 377.680442
  SIZE           583 421
  SHAPEPATH      "/home/nms/MapServerData/data/"
  IMAGECOLOR     255 255 255
  STATUS     ON
  TRANSPARENT ON
  SYMBOLSET "/home/nms/MapServerData/symbol/symbol.sym"







  WEB
    TEMPLATE  "/home/nms/MapServerData/data/temp1.html"
    IMAGEPATH "/home/nms/MapServerData/img/"
    IMAGEURL  "/img/"
    LOG "/home/nms/MapServerData/logs/mapserver.log"
  END

  LEGEND
    KEYSIZE 12 12
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      COLOR 0 0 89
    END
    STATUS ON
  END

  SCALEBAR
    IMAGECOLOR 255 255 255
    LABEL
      COLOR 0 0 0
      SIZE TINY
    END
    STYLE 1
    SIZE 100 2
    COLOR 0 0 0
    UNITS METERS
    INTERVALS 2
  # TRANSPARENT FALSE
    STATUS ON
  END # Scalebar object ends



  # Start of LAYER DEFINITIONS ---------------------------------------------
    LAYER # MODIS raster layer begins here
      NAME         modis

      CLASS
         NAME 'I AM ICON'

#KEYIMAGE "/home/nms/MapServerData/data/z.png" #z.gif'
         SYMBOL '/home/nms/MapServerData/data/z.gif'
         #SYMBOL 'd'

      END

    # DATA         "statesp020"
      DATA         "DRDO.png"
      STATUS       OFF
      TYPE        RASTER
      PROCESSING "DITHER=YES"
    #  PROCESSING "SCALE_1=409,1203"
     # PROCESSING "SCALE_2=203,296"
     # PROCESSING "SCALE_3=339,1004"
    #  PROCESSING "SCALE=AUTO"
#TILEINDEX DRDO.shp
#TILEITEM Location

TRANSPARENCY ALPHA

CONNECTIONTYPE OGR
    CONNECTION "DRDO.ovf"



      PROCESSING   "BANDS=1 2 3"
    #  OFFSITE     255 255 255







JOIN
    NAME "test"
    TABLE "DRDO.dbf"
    FROM "ipForwarding"
    TO "LOCATION"
    TYPE ONE-TO-ONE
  END

METADATA
 "t" "x"
END




     # CLASSITEM "[pixel]"

    # class using simple string comparison, equivelent to ([pixel])
      CLASS
         NAME "CCC"
         TEXT "CCCC"
         EXPRESSION "0"
         STYLE
           COLOR 0 0 0
         END
      END

    # class using an EXPRESSION using only [pixel].
      CLASS
         NAME "AAA"
         EXPRESSION ([pixel] >= x+64 AND [pixel] < 128)
         STYLE
            COLOR 255 0 0
         END
      END

    # class using the red/green/blue values from the palette
      CLASS
          NAME "near white"

          EXPRESSION ([red] > 200 AND [green] > 200 AND [blue] > 200)

          STYLE
            # SYMBOL 1
             COLOR 0 255 0

          END
       END

      # Class using a regular expression to capture only pixel values ending
in 1
       CLASS
           NAME "BBB"
           EXPRESSION /*1/
           STYLE
              COLOR 0 0 255
           END
        END








    END # States polygon layer ends here
    # End of LAYER DEFINITIONS -------------------------------

END # All map files must come to an end just as all other things must come
to...



<html>
<head>
<title>MapServer Workshop</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<l!nk type="text/css" rel="stylesheet" />
</head>

<body bgcolor="#FFFFFF" text="#000000">



<!-- START OF MAPSERVER FORM -->
<form name="mapserv" method="GET" action="/cgi-bin/mapserv">

<!-- HIDDEN MAPSERVER CGI VARIABLES -->

    <input type="hidden" name="map" value="[map]">
    <input type="hidden" name="imgext" value="0.0 0.0 583.0 421.0">
   <input type="hidden" name="layer" value="modis">
 <input type="hidden" name="imgxy" value="290 210">
<input type="hidden" name="mode" value="browse">
<input type="hidden" name="ICON" value="modis,0">
<input type="hidden" name="savemap" value="true">

<!-- FORM SUBMIT BUTTON -->
          <div align="center">
        <input type="submit" name="submit" value="Refresh">
          </div>

<!-- ZOOM/PAN CONTROLS -->
          <div align="center">Map Control: <br>
                <select name="zoom">
                  <option value="4" [zoom_4_select]>Zoom In 4x</option>
                  <option value="3" [zoom_3_select]>Zoom In 3x</option>
                  <option value="2" [zoom_2_select]>Zoom In 2x</option>
                  <option value="1" [zoom_1_select]>Recenter</option>
                  <option value="-2" [zoom_-2_select]>Zoom Out 2x</option>
                  <option value="-3" [zoom_-3_select]>Zoom Out 3x</option>
                  <option value="-4" [zoom_-4_select]>Zoom Out 4x</option>
                </select>
              </div>

<!-- REFERENCE AND LEGEND COLUMN -->
 <p>Legend:<br>  <img name="legend" src="[legend]"></p>

<!-- DISPLAY THE MAPSERVER-CREATED MAP IMAGE -->

          <input type="image" name="img" src="[img]"/>
    <img src="[scalebar]">

</form>

</body>
</html>




More information about the MapServer-users mailing list