Hi Bart,
Bart van den Eijnden (OSGIS) wrote:
Arnaud,
which SRS's are you advertizing in the MAP file? You need to advertize
them using WMS_SRS (or the more general OWS_SRS) metadata.
In the (attached) map file -a barely modified itasca.map from the demo-
I advertise epsg 26915, but I thought (erroneously) that the epsg 4326
would be supported as well.
Still, I found it funny that both CRS and SRS work for valid Epsg IDs,
and that SRS doesn't work for invalid Epsg IDs.
Regards,
Arnaud
Can you post your current MAP file?
Best regards,
Bart
Arnaud Diederen wrote:
Hello,
When I issue a GetCapabilities on my installation of mapserver, using
the following URL:
http://localhost/cgi-bin/mapserv?map=/var/www/workshop/ita
sca.map&service=WMS&version=1.3&request=GetCapabilities
I get a capabilities document showing:
<WMT_MS_Capabilities version="1.1.1">
So, the service expects requests of version 1.1.1 of the WMS spec,
but when I issue a GetFeatureInfo with this URL:
http://localhost/cgi-bin/mapserv?map=/var/www/workshop/itasca.map&SRS=EPSG:4326&BBOX=-99.30245,43.4354,-87.36445,49.404399999999995&TRANSPARENT=TRUE&BGCOLOR=0xFFFFFF&EXCEPTIONS=application/vnd.ogc.se_xml&WIDTH=800&HEIGHT=400&LAYERS=airports&STYLES=&REQUEST=GetFeatureInfo&VERSION=1.3&SERVICE=WMS&INFO_FORMAT=gml&X=363&Y=121&FEATURE_COUNT=100&QUERY_LAYERS=airports
I get the following error:
<ServiceExceptionReport version="1.1.1">
<ServiceException code="InvalidSRS">
msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS
must be valid for all requested layers.
</ServiceException>
</ServiceExceptionReport>
hmm. But then, if I change the SRS parameter name to CRS, I get a
valid (though empty) result:
<msGMLOutput
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
</msGMLOutput>
The weird thing is that in the version 1.1.1 of the spec, there is no
CRS parameter for the GetFeatureInfo, but an SRS parameter. SRS was
changed to CRS at version 1.3.
It looks to me like a bug, am I wrong?
Best regards,
Arnaud
Last Minute Addendum: When I try with the equivalent (projected)
native logical bbox, in the native SRS (EPSG:26915, this is the
Itasca demo!) mapserver doesn't mind the name of the SRS param. Both
SRS and CRS work. Now, I'm totally lost o_O
Will mapserver refuse to work properly if asked for features with a
4326 box?
Thanks for any information!
#
# Start of map file
#
MAP
NAME ITASCA
STATUS ON
SIZE 600 600
EXTENT 388107.634400379 5203120.88405952 500896.339019834 5310243.30613897
UNITS METERS
SHAPEPATH "data"
IMAGECOLOR 255 255 255
TEMPLATEPATTERN "itasca"
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 symbol definitions (we're only using a few)
#
SYMBOL
NAME 'circle'
TYPE ELLIPSE
POINTS 1 1 END
FILLED TRUE
END
SYMBOL
NAME 'star'
TYPE VECTOR
FILLED TRUE
POINTS
0 .375
.35 .375
.5 0
.65 .375
1 .375
.75 .625
.875 1
.5 .75
.125 1
.25 .625
END
END
#
# Start of web interface definition (including WMS enabling metadata)
#
WEB
HEADER templates/header.html
TEMPLATE "set in index.html"
FOOTER templates/footer.html
MINSCALE 1000
MAXSCALE 1550000
IMAGEPATH "set in index.html"
IMAGEURL "set in index.html"
METADATA
WMS_TITLE "UMN MapServer Itasca Demo"
WMS_ABSTRACT "This is a UMN MapServer application for Itasca County
located in north central Minnesota."
WMS_ACCESSCONSTRAINTS "none"
# change this value to match your setup
WMS_ONLINERESOURCE
"http://localhost/cgi-bin/mapserv?map=/var/www/workshop/itasca.map"
WMS_SRS "EPSG:26915"
END
END
#
# Start of reference map
#
REFERENCE
IMAGE graphics/reference.png
EXTENT 393234.393701263 5205405.16440722 495769.579718949 5307959.02579127
SIZE 120 120
STATUS ON
MINBOXSIZE 5
MAXBOXSIZE 100
COLOR 255 0 0
OUTLINECOLOR 0 0 0
MARKERSIZE 8
MARKER 'star'
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 0 0 0
LABEL
COLOR 255 255 255
SIZE TINY
END
STYLE 1
SIZE 100 2
COLOR 255 255 255
UNITS MILES
INTERVALS 1
TRANSPARENT TRUE
STATUS ON
END
#
# Start of layer definitions
#
LAYER
NAME drgs
TYPE RASTER
STATUS OFF
# OFFSITE 31
OFFSITE 252 252 252
CLASS
NAME 'Digital Raster Graphic'
KEYIMAGE graphics/drgs_keyimage.png
END
METADATA
WMS_TITLE "USGS 1:250,000 Digital Raster Graphic"
WMS_ABSTRACT "Hibbing and Bemidji quadrangles. See
http://deli.dnr.state.mn.us/metadata/full/drgncim1.html for more information."
WMS_SRS "EPSG:26915"
END
TILEINDEX drgidx
END
LAYER
NAME ctybdpy2
TYPE POLYGON
STATUS DEFAULT
DATA ctybdpy2
# no need for a background IF the USGS quads are being drawn
REQUIRES "![drgs]"
CLASSITEM 'cty_name'
CLASS
EXPRESSION 'Itasca'
STYLE
OUTLINECOLOR 128 128 128
COLOR 225 225 185
END
END
CLASS # every other county in the state
EXPRESSION /./
STYLE
OUTLINECOLOR 128 128 128
COLOR 255 255 255
END
END
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
END
LAYER
NAME mcd90py2
GROUP cities
TYPE POLYGON
DATA mcd90py2
STATUS OFF
CLASSITEM city_name
CLASS
NAME "Cities & Towns"
EXPRESSION /./
STYLE
COLOR 255 225 90
END
TEMPLATE "templates/mcd90py2.html"
END
HEADER "templates/mcd90py2_header.html"
FOOTER "templates/mcd90py2_footer.html"
DUMP TRUE # allow GML export
METADATA
WMS_TITLE "Minor Civil Divisions"
WMS_ABSTRACT "Minor civil divisions for Itasca County (boundaries only)."
WMS_SRS "EPSG:26915"
END
END
LAYER
NAME twprgpy3
TYPE POLYGON
DATA twprgpy3
STATUS OFF
CLASS
NAME 'Townships'
STYLE
SYMBOL 'circle'
SIZE 2
OUTLINECOLOR 181 181 145
END
END
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
END
LAYER
NAME lakespy2
TYPE POLYGON
STATUS OFF
DATA lakespy2
CLASS
NAME 'Lakes & Rivers'
TEMPLATE "templates/lakespy2.html"
STYLE
COLOR 49 117 185
END
END
HEADER "templates/lakespy2_header.html"
FOOTER "templates/lakespy2_footer.html"
TOLERANCE 3
DUMP TRUE # 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
END # lakes
LAYER
NAME dlgstln2
TYPE LINE
STATUS OFF
DATA dlgstln2
CLASS
NAME "Streams"
TEMPLATE "templates/dlgstln2.html"
STYLE
COLOR 49 117 185
END
END
HEADER "templates/dlgstln2_header.html"
FOOTER "templates/dlgstln2_footer.html"
TOLERANCE 5
DUMP TRUE # 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
END # streams
LAYER
NAME ctyrdln3
GROUP roads
MAXSCALE 300000
STATUS OFF
DATA ctyrdln3
TYPE LINE
CLASS
STYLE
COLOR 0 0 0
END
END
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
END # county roads
LAYER
NAME ctyrdln3_anno
GROUP roads
MAXSCALE 300000
STATUS OFF
DATA ctyrdln3
TYPE ANNOTATION
LABELITEM "road_name"
CLASS
STYLE
COLOR 255 255 255
SYMBOL 'symbols/ctyhwy.png'
END
LABEL
MINFEATURESIZE 40
MINDISTANCE 150
POSITION CC
SIZE TINY
COLOR 0 0 0
END
END
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
END # county road annotation
LAYER
NAME majrdln3
GROUP roads
MAXSCALE 600000
STATUS OFF
DATA majrdln3
TYPE LINE
CLASS
NAME "Roads"
STYLE
COLOR 0 0 0
END
END
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
END # highways
LAYER
NAME majrdln3_anno
GROUP roads
MAXSCALE 600000
STATUS OFF
DATA majrdln3
TYPE ANNOTATION
LABELITEM "road_num"
CLASSITEM "road_class"
CLASS
EXPRESSION "3"
STYLE
COLOR 0 0 0 # dummy color
SYMBOL 'symbols/sthwy.png'
END
LABEL
MINFEATURESIZE 50
MINDISTANCE 150
POSITION CC
SIZE TINY
COLOR 0 0 0
END
END
CLASS
EXPRESSION "2"
STYLE
COLOR 0 0 0 # dummy color
SYMBOL 'symbols/ushwy.png'
END
LABEL
MINFEATURESIZE 50
MINDISTANCE 150
POSITION CC
SIZE TINY
COLOR 0 0 0
END
END
CLASS
EXPRESSION "1"
STYLE
COLOR 0 0 0 # dummy color
SYMBOL 'symbols/interstate.png'
END
LABEL
MINFEATURESIZE 50
MINDISTANCE 150
POSITION CC
SIZE TINY
COLOR 255 255 255
END
END
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
END # highway annotation
LAYER
NAME airports
TYPE POINT
DATA airports
STATUS OFF
CLASS
NAME 'Airports'
STYLE
COLOR 128 255 164
SYMBOL 'circle'
SIZE 7
END
TEMPLATE "templates/airports.html"
END
HEADER "templates/airports_header.html"
FOOTER "templates/airports_footer.html"
TOLERANCE 5
METADATA
WMS_TITLE "Airports"
WMS_ABSTRACT "Airport runways for Itasca County."
WMS_SRS "EPSG:26915"
END
END
LAYER
NAME mcd90py2_anno
GROUP cities
TYPE ANNOTATION
DATA mcd90py2
STATUS OFF
LABELITEM "city_name"
CLASSITEM "city_name"
LABELMAXSCALE 500000
CLASS
EXPRESSION /./
LABEL
COLOR 0 0 0
SHADOWCOLOR 218 218 218
SHADOWSIZE 2 2
TYPE BITMAP
SIZE MEDIUM
POSITION CC
PARTIALS FALSE
BUFFER 2
END
END
METADATA
WMS_TITLE "Minor Civil Divisions"
WMS_ABSTRACT "Minor civil divisions for Itasca County (annotation only)."
WMS_SRS "EPSG:26915"
END
END
END # Map File