[Mapserver-users] WMS GetLegendGraphic and KEYIMAGE

Kralidis,Tom [Burlington] Tom.Kralidis at EC.GC.CA
Thu May 11 20:23:13 EDT 2006


 
Are KEYSIZEX and KEYSIZEY implemented?  I tried them and got a mapfile parse error in the response
 
So, my recommendation would be the following when doing either a GetLegendGraphic or mode=legend type request:
 
scan LAYER/CLASS
  if KEYIMAGE is present in LAYER/CLASS
    figure out what the width/height of the KEYIMAGE is (thus overriding LEGEND/KEYSIZE)
    factor that into the output of the legend image's dimensions
  else
    process like any other CLASS type process
 
Then, I would also apply this output by returning correct width/height attributes to LegendURL in GetCapabilities.  Currently, MapServer defaults to 20 x 10 or what LEGEND/KEYSIZE is set to.
 
Comments?
 
..Tom
 

	-----Original Message----- 
	From: Yewondwossen Assefa [mailto:assefa at dmsolutions.ca] 
	Sent: Thu 11-May-06 15:53 
	To: Kralidis,Tom [Burlington] 
	Cc: MAPSERVER-USERS at LISTS.UMN.EDU 
	Subject: Re: [UMN_MAPSERVER-USERS] [Mapserver-users] WMS GetLegendGraphic and KEYIMAGE
	
	

	Tom,
	
	  Reading through the e-mail, I am still not convinced what the best
	solution is : I think that the default behavior which is to return the
	icons using the same size for all the class (containing either keyimage
	or not) seems to be the most reasonable.
	  Which part do you see needs a modification :
	   * the code generating a GetLegendGraphic url inside the capabilities
	(possibility to use other width/height parameters different from the one
	set in the legend object)
	   * being able to set a specific icon size on the class that takes
	priority over the keysizex, keysizey of the legend object
	  * other changes.
	
	  Later,
	
	
	Kralidis,Tom [Burlington] wrote:
	> (dusting off this email)
	>
	> Assefa,
	>
	> Any update on this one?  I'm trying an OGC:WMS 1.1.1 GetLegendGraphic
	> request off a layer with a CLASS/KEYIMAGE and get returned the same
	> behaviour.  Trying to see CLASS/KEYSIZE or CLASS/KEYIMAGEX /
	> CLASSKEYIMAGEY returns mapfile error.
	>
	> Thanks
	>
	> ..Tom
	>
	>
	>
	>
	>>-----Original Message-----
	>>From: Yewondwossen Assefa [mailto:assefa at dmsolutions.ca]
	>>Sent: Thursday, July 08, 2004 4:00 PM
	>>To: Kralidis,Tom [Burlington]
	>>Cc: mapserver-users at lists.gis.umn.edu
	>>Subject: Re: [Mapserver-users] WMS GetLegendGraphic and KEYIMAGE
	>>
	>>
	>>Tom,
	>>
	>>  I understand what you suggest but at the same time, the keyimage is
	>>just an additional way to generate icons beside the defaut way of
	>>generating them (using classes defined on the layer). Thus the use of
	>>the legend's  keysizex and keysizey is the one that make more
	>>sense. If
	>>we add a specific size parameters for layers using a
	>>keyimage, we need
	>>to do the same for other types of layers so we can generate icons of
	>>diffrent siezes. What I propose as a compromise is to maybe use a
	>>metadata at the layer level that would be used by the
	>>LegendURL to fetch
	>>the width and height for that specific layer. By default the
	>>LegendURL
	>>would use the legend's keysizex/keysizey.  Is this acceptable ?
	>>
	>>Later,
	>>
	>>Kralidis,Tom [Burlington] wrote:
	>>
	>>
	>>>>-----Original Message-----
	>>>>From: Yewondwossen Assefa [mailto:assefa at dmsolutions.ca]
	>>>>Sent: Wednesday, July 07, 2004 2:14 PM
	>>>>To: Kralidis,Tom [Burlington]
	>>>>Cc: mapserver-users at lists.gis.umn.edu
	>>>>Subject: Re: [Mapserver-users] WMS GetLegendGraphic and KEYIMAGE
	>>>>
	>>>>
	>>>>If it is for a specific layer, why not use the width and height
	>>>>parameters in the request ? Do you have other suggestions ?
	>>>>
	>>>
	>>>
	>>>I could explicitly, however if I'm a WMS client, my first
	>>
	>>inclination
	>>
	>>>is to do a GetCapabilities, and go from there.  This is where
	>>>LegendURL would be useful.
	>>>
	>>>I suggest a KEYIMAGESIZE be added so that when LegendURL does get
	>>>added to WMS GetCapabilities, that the width and height
	>>
	>>attributes are
	>>
	>>>taken from KEYIMAGESIZE (or, even better, if MapServer can
	>>
	>>figure out
	>>
	>>>the KEYIMAGE value extents :))
	>>>
	>>>What do you think?
	>>>
	>>>..Tom
	>>>
	>>>
	>>>
	>>>
	>>>>Kralidis,Tom [Burlington] wrote:
	>>>>
	>>>>
	>>>>
	>>>>>Right, but doesn't the legend object define a legend for
	>>>>
	>>>>the *entire*
	>>>>
	>>>>
	>>>>>WMS?  This is a specific layer level legend KEYIMAGE --
	>>>>
	>>>>i.e. I don't
	>>>>
	>>>>
	>>>>>want all my legend image dimensions to be the size of the
	>>>>
	>>>>KEYIMAGE in
	>>>>
	>>>>
	>>>>>the one layer.
	>>>>>
	>>>>>..Tom
	>>>>>
	>>>>>
	>>>>>
	>>>>>
	>>>>>
	>>>>>>-----Original Message-----
	>>>>>>From: Yewondwossen Assefa [mailto:assefa at dmsolutions.ca]
	>>>>>>Sent: Wednesday, July 07, 2004 10:21 AM
	>>>>>>To: Kralidis,Tom [Burlington]
	>>>>>>Cc: mapserver-users at lists.gis.umn.edu
	>>>>>>Subject: Re: [Mapserver-users] WMS GetLegendGraphic and KEYIMAGE
	>>>>>>
	>>>>>>
	>>>>>>Tom,
	>>>>>>
	>>>>>> Here is how the size is determined :
	>>>>>>   -  If Width and Height parameter are passed in the
	>>>>>>GetLegendGraphic request , they will be used.
	>>>>>>   - If not, it will use the size oparameters in the
	>>
	>>legend object
	>>
	>>>>>>   - if none of the above is valid, the defaut size will
	>>
	>>be 20/20.
	>>
	>>>>>>Later,
	>>>>>>
	>>>>>>Kralidis,Tom [Burlington] wrote:
	>>>>>>
	>>>>>>
	>>>>>>
	>>>>>>
	>>>>>>>Hi,
	>>>>>>>
	>>>>>>>I've created a WMS, which has a layer, which defines
	>>>>>>
	>>>>>>KEYIMAGE in the
	>>>>>>
	>>>>>>
	>>>>>>
	>>>>>>>CLASS object.
	>>>>>>>
	>>>>>>>>From what I understand, KEYIMAGE points to a static
	>>
	>>image file, so
	>>
	>>>>>>>
	>>>>>>>>when
	>>>>>>>
	>>>>>>>requesting a legend (either through OGC:WMS or classic mapserv
	>>>>>>>mode=legend), the static image is fed back.
	>>>>>>>
	>>>>>>>When I request GetLegendGraphic from my WMS layer with
	>>>>>>
	>>>>>>KEYIMAGE, the
	>>>>>>
	>>>>>>
	>>>>>>
	>>>>>>>image comes back really small (i.e. 20 x 10).  My legend
	>>>>>>
	>>>>>>image is like
	>>>>>>
	>>>>>>
	>>>>>>
	>>>>>>>300 x 50 -- the output image looks like it scrunched
	>>
	>>into 20 x 10.
	>>
	>>>>>>>Suggestions?
	>>>>>>>
	>>>>>>>Thanks
	>>>>>>>
	>>>>>>>..Tom
	>>>>>>>
	>>>>>>>_______________________________________________
	>>>>>>>Mapserver-users mailing list Mapserver-users at lists.gis.umn.edu
	>>>>>>>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
	>>>>>>>
	>>>>>>
	>>>>>>
	>>>>>>--
	>>>>>>----------------------------------------------------------------
	>>>>>>Assefa Yewondwossen
	>>>>>>Software Analyst
	>>>>>>
	>>>>>>Email: assefa at dmsolutions.ca
	>>>>>>http://www.dmsolutions.ca/
	>>>>>>
	>>>>>>Phone: (613) 565-5056 (ext 14)
	>>>>>>Fax:   (613) 565-0925
	>>>>>>----------------------------------------------------------------
	>>>>>>
	>>>>>>
	>>>>>>
	>>>>>
	>>>>>
	>>>>>
	>>>>--
	>>>>----------------------------------------------------------------
	>>>>Assefa Yewondwossen
	>>>>Software Analyst
	>>>>
	>>>>Email: assefa at dmsolutions.ca
	>>>>http://www.dmsolutions.ca/
	>>>>
	>>>>Phone: (613) 565-5056 (ext 14)
	>>>>Fax:   (613) 565-0925
	>>>>----------------------------------------------------------------
	>>>>
	>>>>
	>>>>
	>>>
	>>>
	>>>
	>>
	>>--
	>>----------------------------------------------------------------
	>>Assefa Yewondwossen
	>>Software Analyst
	>>
	>>Email: assefa at dmsolutions.ca
	>>http://www.dmsolutions.ca/
	>>
	>>Phone: (613) 565-5056 (ext 14)
	>>Fax:   (613) 565-0925
	>>----------------------------------------------------------------
	>>
	>>
	>>
	>
	>
	
	
	--
	----------------------------------------------------------------
	Assefa Yewondwossen
	Software Analyst
	
	Email: assefa at dmsolutions.ca
	http://www.dmsolutions.ca/
	
	Phone: (613) 565-5056 (ext 14)
	Fax:   (613) 565-0925
	----------------------------------------------------------------
	
	
	



More information about the mapserver-users mailing list