首页 > 代码库 > MapFile生成WMS

MapFile生成WMS

 

MAP
  NAME "HBWMS"
  STATUS ON
  SIZE 800 600
  EXTENT 107.795 28.559 116.977 33.627
  UNITS METERS
  SHAPEPATH "data/HuBei"
  IMAGECOLOR 255 255 255
  #FONTSET ../etc/fonts.txt

  WEB
    IMAGEPATH "/ms4w/tmp/ms_tmp/"
    IMAGEURL "/ms_tmp/"
    METADATA
      "wms_title"     "HB WMS Server"  ##required
      "wms_onlineresource" "
http://127.0.0.1:8800/cgi-bin/mapserv.exe?"   ##required
      "wms_srs"       "EPSG:4326 EPSG:42304 EPSG:42101 EPSG:4269"  ##recommended
      "wms_enable_request" "*"   ##necessary
    END
  END # Web

  PROJECTION
    "init=epsg:4326"   ##required
  END

  SYMBOL
    NAME "circle"
    TYPE ellipse
    POINTS 1 1 END
  END # Symbol

  #
  # Start of layer definitions
  #
  #province
  LAYER
    NAME "prov"
    METADATA
      "wms_title"    "prov"   ##required
    END
    TYPE POLYGON
    STATUS ON
    DATA "prov"
    PROJECTION
      "init=epsg:4326"   ##recommended
    END
    CLASS
      NAME "prov"
      STYLE
        #COLOR 200 255 0
        OUTLINECOLOR 120 120 120
        LINECAP BUTT
        PATTERN 8 12 END
        WIDTH 1.0
      END # Style
    END # Class
  END # Layer

  #municipality
  LAYER
    NAME "municipality"
    METADATA
      "wms_title"    "municipality"   ##required
    END
    TYPE POLYGON
    STATUS ON
    DATA "municipality"
    PROJECTION
      "init=epsg:4326"   ##recommended
    END
    #FEATURE
    #  POINTS
    #    5 35
    #    25 40
    #    45 40
    #    35 35
    #  END # Points
    #END # Feature
    CLASS
      NAME "municipality"
      #STYLE
        #COLOR 200 255 0
      #  OUTLINECOLOR 60 60 60
      #  WIDTH 1.0
      #END # STYLE
      STYLE
        #COLOR 200 255 0
        OUTLINECOLOR 100 100 100
        WIDTH 0.5
        LINECAP BUTT
        PATTERN 8 12 END
      END # STYLE
    END # Class
  END # Layer
 
  #station
  LAYER
    NAME station
    METADATA
      "wms_title"    "station"  ##required
    END
    TYPE POINT
    STATUS ON
    DATA "station"
    PROJECTION
      "init=epsg:4326"   ##recommended
    END
    CLASS
      NAME "station"
      STYLE
        SYMBOL "circle"
        SIZE 5
        COLOR 251 154 153
      END # Style
    END # Class
  END # Layer

END # Map File

 

 

---------------------------------------------------------------------------------------------------------

http://127.0.0.1:8800/cgi-bin/mapserv.exe?map=d:/ms4w/apps/mapserv-demo/HuBei.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities


http://127.0.0.1:8800/cgi-bin/mapserv.exe?map=d:/ms4w/apps/mapserv-demo/HuBei.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=prov,municipality,station&STYLES=&SRS=EPSG:4326&BBOX=107.795,28.559,116.977,33.627&WIDTH=800&HEIGHT=600&FORMAT=image/png

 

 


http://127.0.0.1:8800/cgi-bin/mapserv.exe?map=d:/ms4w/apps/mapserv-demo/HuBei.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=prov,station&STYLES=&SRS=EPSG:4326&BBOX=107.795,28.559,116.977,33.627&WIDTH=800&HEIGHT=600&FORMAT=image/png

http://127.0.0.1:8800/cgi-bin/mapserv.exe?map=d:/ms4w/apps/mapserv-demo/HuBei.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities

http://127.0.0.1:8800/cgi-bin/mapserv.exe?map=d:/ms4w/apps/mapserv-demo/HuBei.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=prov,municipality,station&STYLES=&SRS=EPSG:4326&BBOX=107.795,28.559,116.977,33.627&WIDTH=800&HEIGHT=600&FORMAT=image/png

http://127.0.0.1:8800/cgi-bin/mapserv.exe?map=D:/ms4w/apps/mapserv-demo/HuBei.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=prov,municipality,station&STYLES=&SRS=EPSG:3785&BBOX=11988509.149011381,3334826.456403561,13017045.801616438,3973228.5166411838&WIDTH=841&HEIGHT=522&FORMAT=image/png

MapFile生成WMS