[mapserver-users] WMS Client Support
Brian Fischer
bfischer at mpls.houstoneng.com
Tue Jun 4 13:48:14 PDT 2002
I want to say thanks to Debbie for her help. Wow this one was so
simple, but took a while to figure out. It turns out that if you have
the STATUS set to ON the WMS layer will not display. If you change the
STATUS to DEFAULT the WMS layer displays. Is a WMS layer suppose to
behave like this? It took me a while to figure this one out, so I hope
it saves someone else some time.
Thanks,
Brian
-----Original Message-----
From: Debbie Pagurek [mailto:pagurekd at agr.gc.ca]
Sent: Tuesday, June 04, 2002 12:50 PM
To: mapserver-users at lists.gis.umn.edu; Brian Fischer
Subject: RE: [mapserver-users] WMS Client Support
First, I'd try to get the WMS layer working all by itself, without
worrying about your other layers or projections. Once you have that
working, try to add in the other layers and projection parameters. As
for projections and WMS layers, I think you have to add the srs
parameter in the connection string e.g.:
&VERSION=1.1.0&REQUEST=GetMap&layers=world&SRS=epsg:4269" and then you
have to add in the projection object in the mapfile. PROJECTION
"init=epsg:4269"
END
The only other thing I notice in the mapfile is that
CONNECTIONTYPE WMS
comes AFTER the CONNECTION string. Perhaps it should go before? Not
sure if that makes a difference or not.
A question for you... have you seen my posts coming through the
mapserver discussion forum? I have been trying to post to the forum for
a couple of days and haven't seen my own posts.
Thanks,
Debbie
>>> "Brian Fischer" <bfischer at mpls.houstoneng.com> 06/04/02 12:57PM >>>
Thanks Debbie. I now see the image in my web browser via the connection
string
(http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?VERSION=1.1.0&REQUEST=get
MAP&LAYERS=bathymetry,prov_bound,drain_fn&FORMAT=image/gif), but I still
don't get the image in my MapServer application. I think my problem may
be related to projections, because I don't get any error messages. It
almost seems like I may be getting a blank image from the WMS server. I
see my other layers in the mapfile, but not the WMS layer. How are
projections handled via the WMS Client Support?
I am trying to get DMSolutions Elevation/Bathymetry data to display.
According to the getCapabilities from that WMS Server the data is in
EPSG:42304. I essentially want the data to be projected to EPSG:4269
(NAD83 DD). Here is my mapfile: Am I using the projections incorrectly?
Or is there something else I am missing in my mapfile or connection
string?
Thanks,
Brian
#Mapfile
# RRBDINviewer.map
MAP
NAME "RRBDINViewer"
EXTENT -104.057243 42.47964 -89.179642 59.99992
SIZE 500 400
FONTSET "d:/rrbdin_dev/tools/mapserv35/fonts/fontset.list"
SYMBOLSET "d:/rrbdin_dev/tools/mapserv35/symbols/symbol.sym"
SHAPEPATH "d:/rrbdin_dev/tools/mapviewer/shapefiles/dd"
UNITS DD
Projection
"init=epsg:4269"
END
WEB
IMAGEPATH "d:/rrbdin_dev/tools/mapserv35/temp_mapserv/"
TEMPLATE rrbdinviewer.html
# MAXSCALE 7000000
END
LEGEND
STATUS ON
IMAGECOLOR 204 204 153
LABEL
TYPE TRUETYPE
ANTIALIAS TRUE
FONT arial
COLOR 0 0 0
SIZE 9
END
END
SCALEBAR
STATUS ON
INTERVALS 4
SIZE 150 6
OUTLINECOLOR 120 120 120
COLOR 0 0 0
IMAGECOLOR 204 204 153
BACKGROUNDCOLOR 204 204 153
STYLE 1
UNITS MILES
LABEL
ANTIALIAS TRUE
COLOR 0 0 0
SIZE tiny
END
END #scalebar
REFERENCE
STATUS ON
EXTENT -104.057243 42.47964 -89.179642 59.99992
IMAGE "d:/rrbdin_dev/tools/mapviewer/images/rrb_refmap.gif"
SIZE 150 153
COLOR -1 -1 -1
OUTLINECOLOR 255 0 0
END #reference
LAYER
NAME bathmetry
METADATA
"wms_title" "Elevation/Bathymetry"
"wms_srs" "EPSG:42304 EPSG:42101 EPSG:4269 EPSG:4326"
"wms_connectiontimeout" "60"
END
TYPE RASTER
STATUS ON
CONNECTION
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?VERSION=1.1.0&REQUEST=get
MAP&LAYERS=bathymetry,prov_bound,drain_fn&FORMAT=image/gif"
CONNECTIONTYPE WMS
PROJECTION
"init=epsg:42304"
END
End #layer DmSolutions
LAYER
NAME pol_bndry
DATA "pol_bnd"
STATUS DEFAULT
TYPE LINE
PROJECTION
"init=epsg:4269"
END
LABELITEM "NAME"
LABELMINSCALE 2000000
CLASS
NAME "Political Boundary"
COLOR 50 50 50
SYMBOL 2
LABEL
FORCE TRUE
SIZE 12
COLOR 50 50 50
OUTLINECOLOR 200 200 200
BUFFER 4
TYPE TRUETYPE
FONT arial-bold
ANTIALIAS TRUE
END
END
END
LAYER
NAME watershed
DATA "envirocanada_wtrshd"
STATUS DEFAULT
TYPE LINE
PROJECTION
"init=epsg:4269"
END
CLASS
NAME "Red River Basin"
SYMBOL 'plainline'
COLOR 255 0 0
SIZE 2
END
END
END #map file
-----Original Message-----
From: Debbie Pagurek [mailto:pagurekd at agr.gc.ca]
Sent: Tuesday, June 04, 2002 8:21 AM
To: mapserver-users at lists.gis.umn.edu; Brian Fischer
Subject: Re: [mapserver-users] WMS Client Support
Your WMS request is not formated correctly. For instance, in the layer
from DMSolutions, you are missing REQUEST=getmap:
http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?VERSION=1.1.0&REQUEST=getM
AP&LAYERS=bathymetry&FORMAT=image/gif
Make sure that the URL for your WMS layers are working in a browser
before adding them to your mapfile. Also, I don't know what your other
layers are, but make sure that the order of your layers in your mapfile
is correct so that you aren't covering the WMS layer with opaque layers.
D. Pagurek
>>> "Brian Fischer" <bfischer at mpls.houstoneng.com> 06/03/02 02:42PM >>>
Hi MapServer WMS users,
I am new to the WMS feature of MapServer. I am trying to add a WMS
layer to my current mapserver application and I am not having any
success. I have read through the WMS Client HowTo and an old posted
message
(http://mapserver.gis.umn.edu/cgi-bin/wilma_hiliter/mapserver-users/0204
/msg00314.html) and neither seem to work for me. I am using
MapServer3.5 with WMS_Client Support.
When I insert the WMS layer into the map file all I see in the web
browser are my non-wms layers. None of the WMS layers seem to show up.
I have tried two different WMS layers; one from the Geography Network as
used in the old posted message and one by DMSoultions in the WMS HowTo.
My map file is attached below. Can anyone see any reason why the WMS
layers wouldn't be showing up in the web browser?
Thanks,
Brian
# RRBDINviewer.map
MAP
NAME "RRBDINViewer"
EXTENT -104.057243 42.47964 -89.179642 59.99992
SIZE 500 400
FONTSET "d:/rrbdin_dev/tools/mapserv35/fonts/fontset.list"
SYMBOLSET "d:/rrbdin_dev/tools/mapserv35/symbols/symbol.sym"
SHAPEPATH "d:/rrbdin_dev/tools/mapviewer/shapefiles/dd"
UNITS METERS
Projection
"init=epsg:4326"
END
WEB
IMAGEPATH "d:/rrbdin_dev/tools/mapserv35/temp_mapserv/"
TEMPLATE rrbdinviewer.html
MAXSCALE 7000000
END
QUERYMAP
STATUS ON
STYLE HILITE
COLOR 255 255 0
END
LEGEND
STATUS ON
IMAGECOLOR 204 204 153
LABEL
TYPE TRUETYPE
ANTIALIAS TRUE
FONT arial
COLOR 0 0 0
SIZE 9
END
END
SCALEBAR
STATUS ON
INTERVALS 4
SIZE 150 6
OUTLINECOLOR 120 120 120
COLOR 0 0 0
IMAGECOLOR 204 204 153
BACKGROUNDCOLOR 204 204 153
STYLE 1
UNITS MILES
LABEL
ANTIALIAS TRUE
COLOR 0 0 0
SIZE tiny
END
END #scalebar
REFERENCE
STATUS ON
EXTENT -104.057243 42.47964 -89.179642 59.99992
IMAGE "d:/rrbdin_dev/tools/mapviewer/images/rrb_refmap.gif"
SIZE 150 153
COLOR -1 -1 -1
OUTLINECOLOR 255 0 0
END #reference
LAYER
NAME "esri"
METADATA
"wms_title" "ESRI - WORLD"
"wms_srs" "epsg:4326"
"wms_connectiontimeout" "1000"
END
TYPE RASTER
STATUS ON
CONNECTION
"http://www.geographynetwork.com/servlet/com.esri.wms.Esrimap?ServiceNam
e=ESRI_World&VERSION=1.0.0&REQUEST=map&Layers=Rivers&Format=gif"
CONNECTIONTYPE WMS
PROJECTION
"init=epsg:4326"
END
End #layer esri
LAYER
NAME bathmetry
METADATA
"wms_title" "Elevation/Bathymetry"
"wms_srs" "EPSG:42403 EPSG:4269 EPSG:4326"
END
TYPE RASTER
STATUS ON
CONNECTION
"http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?VERSION=1.1.0&LAYERS=bath
ymetry&FORMAT=image/gif"
CONNECTIONTYPE WMS
PROJECTION
"init=epsg:4326"
END
End #layer DmSolutions
LAYER
NAME pol_bndry
DATA "pol_bnd"
STATUS DEFAULT
TYPE LINE
PROJECTION
"init=epsg:4326"
END
LABELITEM "NAME"
LABELMINSCALE 2000000
CLASS
NAME "Political Boundary"
COLOR 50 50 50
SYMBOL 2
LABEL
FORCE TRUE
SIZE 12
COLOR 50 50 50
OUTLINECOLOR 200 200 200
BUFFER 4
TYPE TRUETYPE
FONT arial-bold
ANTIALIAS TRUE
END
END
END
LAYER
NAME watershed
DATA "envirocanada_wtrshd"
STATUS DEFAULT
TYPE LINE
PROJECTION
"init=epsg:4326"
END
CLASS
NAME "Red River Basin"
SYMBOL 'plainline'
COLOR 255 0 0
SIZE 2
END
END
END #map file
More information about the MapServer-users
mailing list