[Mapserver-users] Mapscript doesn't write map file in expecte d order!

Daniel Morissette dmorissette at dmsolutions.ca
Thu Feb 26 13:59:37 EST 2004


Kralidis,Tom [Burlington] wrote:
> 
>>-----Original Message-----
>>From: Xiaoyuan Geng [mailto:gengx at agr.gc.ca] 
>>Sent: Thursday, February 26, 2004 1:12 PM
>>To: warmerdam at pobox.com
>>Cc: mapserver-users at lists.gis.umn.edu
>>Subject: Re: [Mapserver-users] Mapscript doesn't write map 
>>file in expected order!
>>
>>
>>The map file updated from the PHP mapscript is expected to be 
>>readable with WMS clients or viewers such as Intergraph's 
>>WMSVIEWER. The segment of the METADATA produced from the 
>>script is not well ordered and the map file is not valid for 
>>the WMS viewers. After I rearrange the order and get ride of 
>>the tabs manually, everything works fine. That is why this 
>>issue matters in my case. Also the PHP mapscripts add more 
>>unwanted segments such as "scalebar" and "querymap". However 
>>I might overlooked some other bugs from side.
>>
> 
> 
> What is the URL of your WMS?  Note that mapfiles have _nothing_ to do with
> WMS.  The mapfile is the runtime configuration of mapserv CGI.
> 

Tom is right that the mapfile is not directly seen by WMS clients.  It 
is only used to produce the GetCapabilities response which is what the 
WMS clients see.

Also note that the metadata entries are stored internally in MapServer 
as a hash table, so their ordering in the mapfiles doesn't matter. 
That's also why when you save a mapfile using MapScript the order of 
metadata entries may be messed up (hash tables can't maintain ordering).

Finally, the unwanted parameters such as "scalebar" and "querymap" that 
you see in the mapfile are added there with their internal default 
values by the savemap function, so it's not a bug on your side.  The 
savemap is designed as a mean to serialize the current stats of a 
mapfile, that's why comments are lost, the formatting changes, and some 
parameters may be added even if you don't set them explicitly.

HTH

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               dmorissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------




More information about the mapserver-users mailing list