[mapserver-users] WMS server error. Invalid layer(s) given in the LAYERS parameter
Rahkonen Jukka
jukka.rahkonen at mmmtike.fi
Mon Sep 23 07:24:57 PDT 2013
Hi,
Your latest mail shows that you do not know yet how a complete and valid GetMap request looks like. Later in this mail you will see an example.
Read about EXTENT from http://mapserver.org/mapfile/map.html
Read carefully http://mapserver.org/ogc/wms_server.html
The mapfile on this page is quite a bit more complete than yours but we can try to improve it. Let's have a try by using EPSG:4326 as a default output projection
- Add MS_ERRORFILE into your mapfile at MAP level
- Add EXTENT -90 -180 90 180 at MAP level (or better the real extents of your data in EPSG:4326 units)
- Add UNITS DD at MAP level
- Add projection block at MAP level
PROJECTION
"init=epsg:4326"
END
- Add projection block at LAYER level (what is the projection of your table in Oracle?)
- Add DEBUG 5 at LAYER level
- Make your request and look what gets written into the MS_ERRORFILE.
Tell us how your GetMap looks like. If you do not know, have a look at the logfile \ms4w\Apache\logs\access.log, the request get logged there.
Proper request would look about like this
http://localhost/cgi-bin/mapserv.exe?map=your.map&
REQUEST=GetMap&
SERVICE=WMS&
VERSION=1.1.1&
WIDTH=459&
HEIGHT=651&
LAYERS=TestMap&
TRANSPARENT=TRUE&
FORMAT=image/png&
BBOX=-180,-90,180,90&
SRS=EPSG:4326&
STYLES=
The error suggests that you are giving a layer name that does not exist in your system, thus something else than "TestMap". It may not be a good idea to have same name for the service and layer. Consider renaming the service into TestService and layer into TestLayer, it may save your hair in the future.
I hope this helps you a bit further.
-Jukka Rahkonen-
Paul S wrote:
>
> I am not sure if I double-posted this - if so - apologies!
>
>
> I installed MS4W a few days ago to put together a small proof-of-concept.
> I've been through the tutorial, which I got to work with a little tweaking.
> When I attempt to use an Oracle spatial table, I get a MS server error:
> Invalid layers(s)... error - which gives me little indication of where I am going
> wrong.
>
> Can anyone spot a problem here? I am running out of hair to pull out.
>
> I have the Oracle client installed on my local machine and am attempting to
> draw a map from a spatial table on a local vm on which I have Oracle Spatial
> running (10g).
>
> I tried OGRINFO using the Oracle login credentials and table name - with
> immediate success.
>
> mapserv -v shows that ORACLESPATIAL is a valid option
>
> GetCapabiltiies contains no warnings
>
> The map file is very simple - I have tried at least one hundred variations.
>
> The data table has a SRID (though I have other tables with SRIDs and tables
> without). I've included the SRID in wms_srs and I have excluded it. I am
> beginning to believe the problem lies elsewhere - but have no idea what
> approach to use to find it, other than stabbing in the dark.
>
> The map file contents are listed below. Thanks for any advice/pointers you can
> offer.
>
> MAP
> NAME "Map1"
> SIZE 600 400
> WEB
> IMAGEPATH "/tmp/ms_tmp/"
> TEMPLATE "..\Templates\TEMPLATE2.HTML"
> METADATA
> "wms_enable_request" "*"
> "wms_title" "TestMap"
> "wms_srs" "EPSG:2205"
> END
> END
>
> LAYER
> NAME TestMap
> TYPE LINE
> STATUS ON
> UNITS METERS
> CONNECTIONTYPE ORACLESPATIAL
> CONNECTION "test_user/test_user at LOCALVM1"
> DATA "SHAPE FROM (SELECT SHAPE FROM XNA_ROUTES)"
> METADATA
> "wms_enable_request" "*"
> "wms_name" "TestMap"
> "wms_title" "TestMapTitle"
> "wms_srs" "EPSG:4326"
> "wms_format" "image/gif"
> END
> END #LAYER
>
>
> END #MAP
>
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/WMS-
> server-error-Invalid-layer-s-given-in-the-LAYERS-parameter-tp5079259.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list