[Mapserver-users] Beginner -- What's wrong?

Swaminathan, Gayathri gayathri at ou.edu
Tue Sep 2 13:19:31 EDT 2003


Mike,
See that you have only one "PROJECTION" definition and that is commented
out....

Is this how the map file is on demo?

Thanks,

-----Original Message-----
From: Michael Smith [mailto:msmith at sanangelompo.org] 
Sent: Tuesday, September 02, 2003 11:55 AM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] Beginner -- What's wrong?


I have installed a got working the 3.6 demo of MapServer (windows 2000/IIS
5).  When I change the files to insert my shapefiles (tgrds and usa) nothing
appears on the demo screen but I do get the reference map.  Here are my
files used can anyone see what I am doing wrong.  Thanks.

COSADEMO_INIT.HTML file:
<html>
<head><title>MapServer Demo Interface</title></head>
<body bgcolor="#FFFFFF">

<center><h2>MapServer Demo Interface</h2></center>
<p><hr><p>
Click on the initialize button to fire up the demo with 3 layers turned on
will be accessible for browsing. The data are of Itasca County, MN and were
derived, for the most part, from USGS 1:24,000 quadrangles. Some things to
note are:

<form method=GET action="/scripts/mapserv.exe">

<input type="hidden" name="map"
value="c:\Inetpub\wwwroot\itasca\cosademo.map">
<input type="hidden" name="layer" value="usa">
<input type="hidden" name="layer" value="tgrds">
<input type="hidden" name="zoomsize" value=2>

<input type="hidden" name="program" value="/scripts/mapserv.exe"> <input
type="hidden" name="map_web_imagepath" value="C:\Inetpub\wwwroot\tmp\">
<input type="hidden" name="map_web_imageurl"
value="http://192.168.110.21/tmp/">

<center><input type="submit" value="Initialize"></center>

</form>

<p><hr><p>

</body></html>


COSADEMO.MAP file the last 2 layers are what I added (tgroads and USA): MAP
  #
  # Start of map file
  #
  NAME "DEMO"
  STATUS ON
  EXTENT -180.00 -90.0 180.00 90.0
  #EXTENT -180.0 -90.0 180.0 90.0
  SIZE 600 600
  SHAPEPATH "data"
  IMAGECOLOR 255 255 255
  UNITS DD
  # you may need to change this to match your MapServer build
  #IMAGETYPE PNG
  #
  # Projection definition, consult the PROJ.4 documentation for parameter
discussion
  #
  #PROJECTION
  #  "proj=utm"
  #  "ellps=GRS80"
  #  "zone=15"
  #  "north"
  #  "no_defs"
  #
  #  OR:
  #
  #  "init=epsg:26915"
  #END
  #
  # Start of web interface definition (including WMS enabling metadata)
  #
  WEB
    MINSCALE 1000
    MAXSCALE 5550000
    IMAGEPATH "set in cosademo_init.html"
    IMAGEURL "set in cosademo_init.html"
    HEADER "demo_header.html"
    FOOTER "demo_footer.html"
    TEMPLATE "cosademo.html"
    METADATA
      "WMS_TITLE"    "UMN MapServer Itasca Demo"
      "WMS_ABSTRACT"    "This is the UMN MapServer demonstration application
for Itasca County located in north central Minnesota."
      "WMS_ACCESSCONSTRAINTS"    "none"
      "WMS_ONLINERESOURCE" "http://192.168.110.21/itasca/cosademo_init.html"
      "WMS_SRS"    "EPSG:26915"
    END
  END
  #
  # Start of reference map
  #
  REFERENCE
    STATUS ON
    IMAGE "graphics/cosarefer.gif"
    SIZE 120 120
    EXTENT -180.0 -90.0 180.0 90.0
    COLOR -1 -1 -1
    OUTLINECOLOR 255 0 0
  END
  QUERYMAP
    STATUS ON
    SIZE 200 200
    COLOR 255 0 0
    STYLE HILITE
  END
  #
  # Start of legend
  #
  LEGEND
    STATUS ON
    KEYSIZE 18 12
    LABEL
      TYPE BITMAP
      SIZE MEDIUM
      COLOR 0 0 89
    END
  END
  #
  # Start of scalebar
  #
  SCALEBAR
    STATUS TRUE
    COLOR 255 255 255
    IMAGECOLOR 255 255 255
    UNITS MILES
    INTERVALS 1
    SIZE 80 2
    STYLE 1
    LABEL
      SIZE tiny
      COLOR 255 255 255
    END
  END
  #
  # Start of symbol definitions (we're only using a few)
  #
  SYMBOL
    NAME "circle"
    TYPE ELLIPSE
    FILLED TRUE
    POINTS
       1 1
    END
  END
  #
  # Start of layer definitions
  #
  LAYER
    NAME "ctybdpy2"
    STATUS OFF
    DATA "ctybdpy2"
    TYPE POLYGON
    CLASSITEM "cty_name"
    METADATA
      "WMS_TITLE"    "County Boundary"
      "WMS_ABSTRACT"    "Itasca County boundary shapefile. See
http://deli.dnr.state.mn.us/metadata/full/ctybdne2.html for more
information."
      "WMS_SRS"    "EPSG:26915"
    END
    CLASS
      EXPRESSION "Itasca"
      COLOR 225 225 185
      OUTLINECOLOR 128 128 128
    END
    CLASS
      # every other county in the state
      EXPRESSION /./
      COLOR 255 255 255
      OUTLINECOLOR 128 128 128
    END
  END
  LAYER
    NAME "mcd90py2"
    GROUP "cities"
    STATUS OFF
    DATA "mcd90py2"
    TYPE POLYGON
    CLASSITEM "city_name"
    HEADER "mcd90py2_header.html"
    FOOTER "mcd90py2_footer.html"
    # allow GML export
    METADATA
      "WMS_TITLE"    "Minor Civil Divisions"
      "WMS_ABSTRACT"    "Minor civil divisions for Itasca County.
(boundaries only)"
      "WMS_SRS"    "EPSG:26915"
    END
    CLASS
      NAME "Cities & Towns"
      EXPRESSION /./
      COLOR 255 225 90
      TEMPLATE "mcd90py2.html"
    END
  END
  LAYER
    NAME "twprgpy3"
    STATUS OFF
    DATA "twprgpy3"
    TYPE POLYGON
    METADATA
      "WMS_TITLE"    "Township Boundaries"
      "WMS_ABSTRACT"    "Pulic Land Survey (PLS) township boundaries for
Itasca County. See http://deli.dnr.state.mn.us/metadata/full/twprgne2.html
for more information."
      "WMS_SRS"    "EPSG:26915"
    END
    CLASS
      NAME "Townships"
      SYMBOL "circle"
      OUTLINECOLOR 181 181 145
      SIZE 2
    END
  END
  LAYER
    NAME "lakespy2"
    STATUS OFF
    DATA "lakespy2"
    TYPE POLYGON
    TOLERANCE 3
    HEADER "lakespy2_header.html"
    FOOTER "lakespy2_footer.html"
    # allow GML export
    METADATA
      "WMS_TITLE"    "Lakes and Rivers"
      "WMS_ABSTRACT"    "DLG lake and river polygons for Itasca County. See
http://deli.dnr.state.mn.us/metadata/full/dlglkpy2.html for more
information."
      "WMS_SRS"    "EPSG:26915"
    END
    CLASS
      NAME "Lakes & Rivers"
      COLOR 49 117 185
      TEMPLATE "lakespy2.html"
    END
  END
  # lakes
  LAYER
    NAME "dlgstln2"
    STATUS OFF
    DATA "dlgstln2"
    TYPE LINE
    TOLERANCE 5
    HEADER "dlgstln2_header.html"
    FOOTER "dlgstln2_footer.html"
    # allow GML export
    METADATA
      "WMS_TITLE"    "Streams"
      "WMS_ABSTRACT"    "DLG streams for Itasca County. See
http://deli.dnr.state.mn.us/metadata/full/dlgstln2.html for more
information."
      "WMS_SRS"    "EPSG:26915"
    END
    CLASS
      NAME "Streams"
      COLOR 49 117 185
      TEMPLATE "dlgstln2.html"
    END
  END
  # streams
  LAYER
    NAME "ctyrdln3"
    GROUP "roads"
    STATUS OFF
    DATA "ctyrdln3"
    TYPE LINE
    MAXSCALE 300000
    METADATA
      "WMS_TITLE"    "County Roads"
      "WMS_ABSTRACT"    "County roads. (lines only)  Derived from MNDOT
roads layer, see http://deli.dnr.state.mn.us/metadata/full/dotrdln2.html for
more information."
      "WMS_SRS"    "EPSG:26915"
    END
    CLASS
      COLOR 0 0 0
    END
  END
  # county roads
  LAYER
    NAME "ctyrdln3_anno"
    GROUP "roads"
    STATUS OFF
    DATA "ctyrdln3"
    TYPE ANNOTATION
    MAXSCALE 300000
    LABELITEM "road_name"
    METADATA
      "WMS_TITLE"    "County Roads"
      "WMS_ABSTRACT"    "County roads. (shields only)  Derived from MNDOT
roads layer, see http://deli.dnr.state.mn.us/metadata/full/dotrdln2.html for
more information."
      "WMS_SRS"    "EPSG:26915"
    END
    CLASS
      SYMBOL "symbols/ctyhwy.gif"
      COLOR 255 255 255
      LABEL
        SIZE TINY
        POSITION CC
        MINDISTANCE 150
        MINFEATURESIZE 40
        COLOR 0 0 0
      END
    END
  END
  # county road annotation
  LAYER
    NAME "majrdln3"
    GROUP "roads"
    STATUS OFF
    DATA "majrdln3"
    TYPE LINE
    MAXSCALE 600000
    METADATA
      "WMS_TITLE"    "Highways"
      "WMS_ABSTRACT"    "Highways- state, US and interstate. (lines only)
Derived from MNDOT roads layer, see
http://deli.dnr.state.mn.us/metadata/full/dotrdln2.html for more
information."
      "WMS_SRS"    "EPSG:26915"
    END
    CLASS
      NAME "Roads"
      COLOR 0 0 0
    END
  END
  # highways
  LAYER
    NAME "majrdln3_anno"
    GROUP "roads"
    STATUS OFF
    DATA "majrdln3"
    TYPE ANNOTATION
    CLASSITEM "road_class"
    MAXSCALE 600000
    LABELITEM "road_num"
    METADATA
      "WMS_TITLE"    "Highways"
      "WMS_ABSTRACT"    "Highways- state, US and interstate. (shields only)
Derived from MNDOT roads layer, see
http://deli.dnr.state.mn.us/metadata/full/dotrdln2.html for more
information."
      "WMS_SRS"    "EPSG:26915"
    END
    CLASS
      EXPRESSION "3"
      # dummy color
      SYMBOL "symbols/sthwy.gif"
      COLOR 0 0 0
      LABEL
        SIZE TINY
        POSITION CC
        MINDISTANCE 150
        MINFEATURESIZE 50
        COLOR 0 0 0
      END
    END
    CLASS
      EXPRESSION "2"
      # dummy color
      SYMBOL "symbols/ushwy.gif"
      COLOR 0 0 0
      LABEL
        SIZE TINY
        POSITION CC
        MINDISTANCE 150
        MINFEATURESIZE 50
        COLOR 0 0 0
      END
    END
    CLASS
      EXPRESSION "1"
      # dummy color
      SYMBOL "symbols/interstate.gif"
      COLOR 0 0 0
      LABEL
        SIZE TINY
        POSITION CC
        MINDISTANCE 150
        MINFEATURESIZE 50
        COLOR 255 255 255
      END
    END
  END
  # highway annotation
  LAYER
    NAME "airports"
    STATUS OFF
    DATA "airports"
    TYPE POINT
    TOLERANCE 5
    HEADER "airports_header.html"
    FOOTER "airports_footer.html"
    METADATA
      "WMS_TITLE"    "Airports"
      "WMS_ABSTRACT"    "Airport runways for Itasca County."
      "WMS_SRS"    "EPSG:26915"
    END
    CLASS
      NAME "Airports"
      SYMBOL "circle"
      COLOR 128 255 164
      SIZE 7
      TEMPLATE "airports.html"
    END
  END
  LAYER
    NAME "cities"
    STATUS OFF
    DATA "mcd90py2"
    TYPE ANNOTATION
    CLASSITEM "city_name"
    LABELITEM "city_name"
    LABELMAXSCALE 500000
    METADATA
      "WMS_TITLE"    "Minor Civil Divisions"
      "WMS_ABSTRACT"    "Minor civil divisions for Itasca County.
(annotation only)"
      "WMS_SRS"    "EPSG:26915"
    END
    CLASS
      EXPRESSION /./
      COLOR -1 -1 -1
      LABEL
        TYPE BITMAP
        SIZE MEDIUM
        POSITION CC
        BUFFER 2
        COLOR 0 0 0
        SHADOWCOLOR 218 218 218
        SHADOWSIZE 2 2
        PARTIALS FALSE
      END
    END
  END
  LAYER
    NAME "tgroads"
    STATUS ON
    DATA "tgrds"
    TYPE LINE
    CLASSITEM "Street"
    UNITS DD
  END
  LAYER
    NAME "usa"
    STATUS DEFAULT
    DATA "usa"
    TYPE POLYGON
    UNITS DD
  END
END

COSADEMO.HTML template file:

<html>
<head><title>MapServer Demo Interface</title></head>
<body bgcolor=#FFFFFF>

<center><h1>MapServer Demo Interface</h1></center>
<hr>
<form method=GET action="[program]">

<center>
<table border=0 cellspacing=0 cellpadding=4 bgcolor="#000000"> <tr> <td
valign="top" align=center>
  <table cellpadding="0" cellspacing="0" border="0">
    <tr><td colspan="2"><INPUT NAME="img" TYPE="image" SRC="[img]" width=600
height=600 border=0></td></tr>
    <tr>
      <td>&nbsp;<font size=-1 face="arial,helvetica"
color="#FFFFFF"><b>Powered by MapServer</b></font></td>
      <td align="right"><img src="[scalebar]"></td>
    </tr>
  </table>
</td>
<td valign="top" bgcolor=#ffffff>
  <table cellpadding="5" cellspacing="0" border="0" bgcolor="#ffffff">
    <tr><td>
      <center><input type="submit" value="Refresh/Query"></center>
      <p>

      <input type="radio" name="mode" value="browse" checked> <b>Browse
map</b><br>
      <input type="radio" name="mode" value="query"> <b>Query
feature</b><br>
      <input type="radio" name="mode" value="nquery"> <b>Query multiple
features</b>

      <hr>

      <p>
      <b>Select Layers to Display: </b><br>
      <select multiple name="layer" size=3>
        <option value="airports" [airports_select]> Airports
        <option value="cities" [cities_select]> Cities
        <option value="lakespy2" [lakespy2_select]> Lakes & Rivers
        <option value="dlgstln2" [dlgstln2_select]> Streams
        <option value="tgrds" [tgrds_select]> Roads
        <option value="usa" [usa_select]> USA
      </select>

      <p>
      Zoom In <input type=radio name=zoomdir value=1 [zoomdir_1_check]>
      Pan <input type=radio name=zoomdir value=0 [zoomdir_0_check]>
      Zoom Out <input type=radio name=zoomdir value=-1 [zoomdir_-1_check]>
      <p>
      Zoom Size <input type=text name=zoomsize size=4 value=[zoomsize]>
      <p>

      <font size=+1><b>Legend</b></font><br><hr>
      <img src="[legend]"><hr>

      <p>
      <center><INPUT NAME="ref" TYPE="image" SRC="[ref]"
border="0"></center>
    </td></tr></table>

  </td></tr>
</table>
</center>

<input type="hidden" name="imgxy" value="299.5 299.5">
<input type="hidden" name="imgext" value="[mapext]">
<input type="hidden" name="map" value="[map]">
<input type="hidden" name="savequery" value="true">

<input type="hidden" name="program" value="[program]">
<input type="hidden" name="map_web_imagepath" value="[map_web_imagepath]">
<input type="hidden" name="map_web_imageurl" value="[map_web_imageurl]">

</form>

<p><hr><p>

</body></html>



Michael Smith, Planner II
City of San Angelo
Planning & Development
325.657.4210 Fax: 325.481.2648
Email: msmith at sanangelompo.org


_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list