[Mapserver-users] WMS LAYERS=

nicolas.fortin at ec.gc.ca nicolas.fortin at ec.gc.ca
Tue Jan 13 07:34:21 PST 2004


Hi Heryk, Normand and list,

I agree, I think I'll not set layers to default for wms.
It's ok for application but has strange behavior when use in some situations
like Heryk mention.

Nick


-----Message d'origine-----
De : Julien, Heryk [mailto:hjulien at nrcan.gc.ca] 
Envoyé : Tuesday, January 13, 2004 10:26 AM
À : 'Normand Savard'; 'nicolas.fortin at ec.gc.ca'
Cc : mapserver-users at lists.gis.umn.edu
Objet : RE: RE : [Mapserver-users] WMS LAYERS=



Hi Norm and Nick,

I made the following observations when calling Mapserver WMS services. This
may be useful for other MS WMS users.

When I call my Mapserver (4.01) WMS service directly through a standard WMS
URL everything is okay. However I get weird layering and "status" problems
in the following 2 situations.

Context: I have a Mapserver WMS service (parent service) calling another
Mapserver WMS service (child service). In other words my mapfile (parent
mapfile) has layers calling another Mapserver WMS service (child mapfile).
The parent mapfile is calling each WMS layers individually from the same
service so that I may insert other layers in between them.

Child service:
http://www.cgcq.rncan.gc.ca/cgi-bin/mapserver/mapserv.exe?map=d:\webcgcq\GAS
L_clf\mapserver\mapfiles\transect1.map&VERSION=1.1.0&REQUEST=GetMap&LAYERS=T
ransect1poly,Geochron,Transect1line,Transect1-coupe&SRS=EPSG:26918&BBOX=6056
52.980,5009993.392,864417.475,5050179.283&width=400&height=400&format=image/
png&

1. If a WMS layer in my parent mapfile is set to default: I get the
following error:
Content-type: image/png ?PNG _
IHDR_____ÀföhäPLTEÿÿÿïoeYß_lêyZ·Æ(tm)k`uß_ztÃò¸ÆæûàÔf-³Ýø^Sf'1°ìØéW"κÇ
ÂÒȺp¤Ä$¸j`^]i81XRfy¨Q£4ò>¾}<fÆ'Í...uÒ-iZj,OE"jp()Íw_Zia¹'_¸"îoehÞݳÞÝÈ_S
aþøÑs¥=¡vÒ~_µ_z^>üàìÕ*½s$?__U4aXè{_ûÝî_ÞÝÝ»´ Ü'Kqpo©©¨C
1ìw¦q!\Ü+_ÂÂÁÿ(_*ëÿÿ¦ÿòÿë¤fp½_ ...

	Still looking for a solution! Maybe someone can correct me on this
but I think you can't set a wms layer to default in a client mapfile (parent
mapfile)?

2. If I set some wms layers to default in the child mapfile, the layering
order is not respected. Indeed since wms layers are call separately from the
same service the default layer is repeated every time. Took me some time to
recognize this! My solution: don't have default layers in a WMS services. Ah
ha!


Hope this can help someone!

Salutations
Héryk


-----Message d'origine-----
De : Normand Savard [mailto:nsavard at dmsolutions.ca]
Envoyé : Monday, January 12, 2004 5:05 PM
À : nicolas.fortin at ec.gc.ca
Cc : hjulien at nrcan.gc.ca; mapserver-users at lists.gis.umn.edu Objet : Re: RE :
[Mapserver-users] WMS LAYERS=


Hi,

I tried to replicate this problem without success by using our WMS 
server used during the OGC compliance tests.   I also used the OGC test 
suite requests.  I joined both the map file and the requests sent (see 
below).  Theses requests contain three layers.  In the first request, 
the "Forest" layer is drawn first.  In the second request, the "Forest" 
layer is drawn last.  You can also see that I modified the mapfile to 
set the "Forest" layer status to "DEFAULT".   It does not seem to affect 
the drawing order.  But maybe I'm missing something.  Do we have access 
your WMS server?  It is possible to have a copy of your mapfile and the 
request you are currently sending?

Norm



The requests used are.


http://www2.dmsolutions.ca/cgi-bin/mswms_ogc_cite?VERSION=1.1.1&REQUEST=GetM
ap&LAYERS=Forests,Lakes,NamedPlaces&STYLES=&SRS=EPSG:4326&BBOX=-0.0042,-0.00
24,0.0042,0.0024&WIDTH=168&HEIGHT=96&FORMAT=image/gif 


http://www2.dmsolutions.ca/cgi-bin/mswms_ogc_cite?VERSION=1.1.1&REQUEST=GetM
ap&LAYERS=NamedPlaces,Lakes,Forests&STYLES=&SRS=EPSG:4326&BBOX=-0.0042,-0.00
24,0.0042,0.0024&WIDTH=168&HEIGHT=96&FORMAT=image/gif 



Our map file is as follow:

#
# Start of map file
#
# $Id: ogc_cite_wms_server.map,Exp $
#
NAME OGC_CITE
STATUS ON
SIZE 600 400
## EPSG:4326 extents
EXTENT -2 -2 -1 6
#EXTENT -0.0042 -0.0024 0.0042 0.0024

UNITS METERS
SHAPEPATH "../data/shapefile"
IMAGECOLOR 255 255 255
FONTSET ../etc/fonts.txt
SYMBOLSET ../etc/symbols.sym

#
# Start of web interface definition
#
WEB
# On Windows systems, /tmp and /tmp/ms_tmp/ should be created at the root #
of the drive where the .MAP file resides. #
  IMAGEPATH "/tmp/ms_tmp/"
  IMAGEURL "/ms_tmp/"
#  LOG "/tmp/gmap.log"
  METADATA
    "WMS_TITLE"         "cite:OGC_CITE WMS Server"
    "WMS_ONLINERESOURCE" 
"http://www2.dmsolutions.ca/cgi-bin/mswms_ogc_cite?"
    "WMS_SRS"           "EPSG:4326"
    "OWS_SCHEMAS_LOCATION" "http://ogc.dmsolutions.ca"
    "WMS_ACCESSCONTRAINTS" "none"
    "WMS_FEES"              "none"

  END
END

PROJECTION
  "init=epsg:4326"
END

QUERYMAP
  SIZE 200 200
  STATUS ON
  STYLE HILITE
  COLOR 255 0 0
END

#
# Start of layer definitions
#

LAYER
  NAME BasicPolygons
  TYPE POLYGON
  STATUS OFF
  DATA BasicPolygons
  PROJECTION
    "init=epsg:4326"
  END
  TEMPLATE "basicpolygons.html"
  CLASS
    NAME "BasicPolygons"
    COLOR 194 194 194
  END
  METADATA
    "WMS_TITLE" "cite:BasicPolygons"
    "WMS_ABSTRACT" "BasicPolygons layer."
#    "WMS_SRS" "EPSG:4326"
  END
END # layer

LAYER
  NAME DividedRoutes
  TYPE LINE
  STATUS ON
  DATA DividedRoutes
  PROJECTION
    "init=epsg:4326"
  END
  CLASS
    NAME "DividedRoutes"
    COLOR 0 0 0
    OUTLINECOLOR 0 0 0
    SYMBOL 'circle'
    SIZE 6
  END
  METADATA
    "WMS_TITLE" "cite:DividedRoutes"
    "WMS_ABSTRACT" "DividedRoutes layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer

LAYER
  NAME DividedRoutes_anno
  STATUS ON
  DATA DividedRoutes
  TYPE ANNOTATION
  LABELITEM "NAME"
  CLASS
    NAME "DividedRoutesAnnotations"
    COLOR 255 255 255
    OUTLINECOLOR 0 0 0
    SYMBOL 'routetag'
    SIZE 40
    OVERLAYSYMBOL "route75"
    OVERLAYSIZE 15
    OVERLAYCOLOR 0 0 0
    LABEL
      POSITION CC
      COLOR 255 255 255
      FONT fritqat
      TYPE truetype
      SIZE 0
      PARTIALS false
    END
  END
  METADATA
    "WMS_TITLE" "DividedRoutes"
    "WMS_ABSTRACT" "Divided routes layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer

LAYER
  NAME MapNeatline
  TYPE LINE
  STATUS ON
  DATA MapNeatline
  PROJECTION
    "init=epsg:4326"
  END
  CLASS
    NAME "MapNeatline"
    COLOR 0 0 0
    SYMBOL 'circle'
    SIZE 3
  END
  METADATA
    "WMS_TITLE" "cite:MapNeatline"
    "WMS_ABSTRACT" "MapNeatline layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer

LAYER
  NAME NamedPlaces
  TYPE POLYGON
  STATUS ON
  DATA NamedPlaces
  PROJECTION
    "init=epsg:4326"
  END
  LABELITEM "NAME"
  CLASSITEM "NAME"
  TEMPLATE "namedplaces.html"
  CLASS
    NAME "Ashton"
    EXPRESSION "Ashton"
    #COLOR 153 153 153
    COLOR 192 192 192
    OUTLINECOLOR 0 0 0
    SIZE 8
    LABEL
      ANGLE AUTO
      COLOR  0 0 0
      BACKGROUNDCOLOR 192 192 192
      FONT fritqat
      TYPE truetype
      SIZE 10
      POSITION LR
      OFFSET 10 10
      PARTIALS FALSE
    END
  END
  CLASS
    NAME "Goose Island"
    EXPRESSION "Goose Island"
    COLOR 255 255 255
    SIZE 8
    TEXT "Goose | Island"
    LABEL
      ANGLE AUTO
      COLOR  0 0 0
      BACKGROUNDCOLOR 255 255 255
      FONT fritqat
      TYPE truetype
      SIZE 4
      POSITION CC
      PARTIALS FALSE
      WRAP "|"
    END
  END
  METADATA
    "WMS_TITLE" "cite:NamedPlaces"
    "WMS_ABSTRACT" "NamedPlaces layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer

LAYER
  NAME Ponds
  TYPE POLYGON
  STATUS ON
  DATA Ponds
  PROJECTION
    "init=epsg:4326"
  END
  TEMPLATE "ponds.html"
  CLASS
    NAME "Ponds"
    COLOR 0 255 255
    OUTLINECOLOR 0 0 0
    TEXT "Stock Pond"
    LABEL
      COLOR  0 0 0
      FONT fritqat
      TYPE truetype
      SIZE 9
      #POSITION AUTO
      POSITION UC
      PARTIALS FALSE
      OFFSET 0 23
    END
  END
  METADATA
    "WMS_TITLE" "cite:Ponds"
    "WMS_ABSTRACT" "Ponds layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer

LAYER
  NAME RoadSegments
  TYPE LINE
  STATUS ON
  DATA RoadSegments
  PROJECTION
    "init=epsg:4326"
  END
  LABELITEM "NAME"
  CLASSITEM "NAME"
  CLASS
    NAME "MainStreet"
    EXPRESSION "Main Street"
    SYMBOL 'circle'
    SIZE 3
    COLOR 238 0 0
    LABEL
      ANGLE AUTO
      COLOR  0 0 0
      FONT fritqat-italic
      TYPE truetype
      SIZE 10
      POSITION UC
      PARTIALS FALSE
      OFFSET 0 2
    END
  END
  CLASS
    NAME "Route5"
    EXPRESSION "Route 5"
    SYMBOL 'circle'
    SIZE 3
    COLOR 0 0 0
  END
  CLASS
    NAME "Route75"
    EXPRESSION "Dirt Road by Green Forest"
    SYMBOL 'circle'
    SIZE 5
    #COLOR 255 255 0
    COLOR 192 160 0
    TEXT "Dirt Road"
    LABEL
      ANGLE 90
      COLOR  0 0 0
      FONT fritqat-italic
      TYPE truetype
      SIZE 10
      POSITION AUTO
      PARTIALS FALSE
      #OUTLINECOLOR 255 255 255
      OFFSET 0 5
    END
  END
  METADATA
    "WMS_TITLE" "cite:RoadSegments"
    "WMS_ABSTRACT" "RoadSegments layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer

LAYER
  NAME RoadSegments_anno
  STATUS ON
  DATA RoadSegments
  TYPE ANNOTATION
  CLASSITEM "FID"
  LABELITEM "NAME"
  CLASS
    NAME "Route5NorthEastAnnotations"
    EXPRESSION "104"
    COLOR 255 255 255
    OUTLINECOLOR 0 0 0
    #OVERLAYCOLOR 0 0 0
    SYMBOL 'routetag'
    SIZE 25
    OVERLAYSYMBOL "route5"
    OVERLAYSIZE 15
    OVERLAYCOLOR 0 0 0
    LABEL
      POSITION CC
      COLOR 255 255 255
      FONT fritqat
      TYPE truetype
      SIZE 0
      PARTIALS false
    END
  END
  CLASS
    NAME "Route5WestAnnotations"
    EXPRESSION "102"
    COLOR 255 255 255
    OUTLINECOLOR 0 0 0
    #OVERLAYCOLOR 0 0 0
    SYMBOL 'routetag'
    SIZE 25
    OVERLAYSYMBOL "route5"
    OVERLAYSIZE 15
    OVERLAYCOLOR 0 0 0
    LABEL
      POSITION CC
      COLOR 255 255 255
      FONT fritqat
      TYPE truetype
      SIZE 0
      PARTIALS false
    END
  END
  METADATA
    "WMS_TITLE" "RoadSegments"
    "WMS_ABSTRACT" "RoadSegments layer."
    "WMS_SRS" "EPSG:4326"
  END
END #Layer

LAYER
  NAME Streams
  TYPE LINE
  STATUS ON
  DATA Streams
  PROJECTION
    "init=epsg:4326"
  END
  LABELITEM "NAME"
  CLASS
    NAME "Streams"
    COLOR 0 0 205
    OUTLINECOLOR 199 199 199
    SYMBOL 'circle'
    SIZE 2
    LABEL
      ANGLE AUTO
      COLOR  0 0 205
      BACKGROUNDCOLOR 255 255 255
      FONT fritqat-italic
      TYPE truetype
      SIZE 10
      POSITION UC
      PARTIALS FALSE
      OFFSET 30 5
    END
  END
  METADATA
    "WMS_TITLE" "cite:Streams"
    "WMS_ABSTRACT" "Streams layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer

LAYER
  NAME Forests
  TYPE POLYGON
#  STATUS ON
  STATUS DEFAULT
  DATA Forests
  PROJECTION
    "init=epsg:4326"
  END
  TEMPLATE "forests.html"
  CLASS
    NAME "Forests"
    COLOR 0 150 0
    OUTLINECOLOR 0 0 0
    MINSIZE 4
    #SYMBOL "sapin"
    SYMBOL "tree-gif"
    SIZE 90
#    OVERLAYSYMBOL "square"
#    OVERLAYSIZE 50
#    OVERLAYCOLOR -1 -1 -1
    TEXT "State | Forest"
    LABEL
      ANGLE AUTO
      COLOR  0 0 0
      BACKGROUNDCOLOR 255 255 255
      FONT fritqat
      TYPE truetype
      SIZE 18
      POSITION AUTO
      PARTIALS FALSE
      WRAP "|"
      OFFSET 100 -60
    END
  END
  METADATA
    "WMS_TITLE" "cite:Forests"
    "WMS_ABSTRACT" "Forests layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer

LAYER
  NAME Bridges
  TYPE POINT
  STATUS ON
  DATA Bridges
  PROJECTION
    "init=epsg:4326"
  END
  LABELITEM "NAME"
  CLASS
    NAME "Bridges"
    COLOR 0 0 0
    SYMBOL 'bridge'
    SIZE 40
    LABEL
      ANGLE AUTO
      COLOR  0 0 0
      FONT fritqat-italic
      TYPE truetype
      SIZE 10
      POSITION AUTO
      PARTIALS FALSE
      OFFSET 20 -8
    END
  END
  METADATA
    "WMS_TITLE" "cite:Bridges"
    "WMS_ABSTRACT" "Bridges layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer

LAYER
  NAME Lakes
  TYPE POLYGON
  STATUS ON
  DATA Lakes
  PROJECTION
    "init=epsg:4326"
  END
  TEMPLATE "lakes.html"
  CLASS
    NAME "Lakes"
    COLOR 0 0 205
    SIZE 8
    TEXT "BLUE | LAKE"
    LABEL
      ANGLE AUTO
      COLOR  255 255 255
      FONT fritqat
      TYPE truetype
      SIZE 9
      POSITION LL
      PARTIALS FALSE
      WRAP "|"
      OFFSET 15 -10
      FORCE true
    END
  END
  METADATA
    "WMS_TITLE" "cite:Lakes"
    "WMS_ABSTRACT" "Lakes layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer

LAYER
  NAME Buildings
  TYPE POLYGON
  STATUS ON
  DATA Buildings
  PROJECTION
    "init=epsg:4326"
  END
  TEMPLATE "buildings.html"
  CLASS
    NAME "Buildings"
    COLOR 255 255 255
    OUTLINECOLOR 0 0 0
  END
  METADATA
    "WMS_TITLE" "cite:Buildings"
    "WMS_ABSTRACT" "Buildings layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer
 
LAYER
  NAME BuildingCenters
  TYPE POINT
  STATUS ON
  DATA BuildingCenters
  PROJECTION
    "init=epsg:4326"
  END
  CLASS
    NAME "BuildingCenters"
    COLOR 0 0 0
    SYMBOL 'circle'
    SIZE 4
  END
  METADATA
    "WMS_TITLE" "cite:BuildingCenters"
    "WMS_ABSTRACT" "BuildingCenters layer."
    "WMS_SRS" "EPSG:4326"
  END
END # layer
 
END # Map File  


nicolas.fortin at ec.gc.ca wrote:

>Hi Heryk,
>
>Only the layer 1 is set to default, all other are set to OFF.  I 
>thought that doesn't matter in WMS cause you only got the layers you 
>are querying.
>
>I set layer 1 to ON and
>1- try LAYERS=2,1 and only got layer 2
>2- try LAYERS=1 and got nothing
>
>I set layer 1 to OFF (like the others) and
>1- try LAYERS=2,1 and only got layer 2
>2- try LAYERS=1 and got nothing
>
>Weird...
>Nick
>
>-----Message d'origine-----
>De : Julien, Heryk [mailto:hjulien at nrcan.gc.ca]
>Envoyé : Monday, January 12, 2004 4:00 PM
>À : 'nicolas.fortin at ec.gc.ca'
>Objet : RE: [Mapserver-users] WMS LAYERS=
>
>
>Hi,
>Are your layers set to "default" in the mapfile? Is so, you will be 
>calling layers 1,2 and all the layers that are set to default! So your 
>might be calling layers 1 and 2 a second time around! Try setting them 
>to "ON".
>
>Bonne chance!
>Héryk
>
>
>-----Message d'origine-----
>De : nicolas.fortin at ec.gc.ca [mailto:nicolas.fortin at ec.gc.ca] Envoyé : 
>Monday, January 12, 2004 3:30 PM À : mapserver-users at lists.gis.umn.edu
Objet
>: [Mapserver-users] WMS LAYERS=
>
>
>Hi list,
>
>When I make a WMS request with the layers parameters like LAYERS=2,1
>
>In accordance to the OGC WMS Spec, layer 1 is suppose to be at the top 
>of layer 2 but it isn't the case...why??
>
>Even if I change to LAYERS=1,2 ... no change
>
>In the mapfile, layer 1 is at the end of the file and is always the top 
>layer on others applications using this mapfile.
>
>
>Thx for your help,
>
>Nicolas Fortin
>Mathématicien, Programmeur, Analyste de données 
>SMC-Québec Hydrologie, Environnement Canada 
>1141, Rte de l'Église, Sainte-Foy(QC) G1V 4H5 
>(418)648-2516 
>nicolas.fortin at ec.gc.ca <mailto:nicolas.fortin at ec.gc.ca> 
>
>_______________________________________________
>Mapserver-users mailing list
>Mapserver-users at lists.gis.umn.edu
>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
>_______________________________________________
>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