MapServer / MapServer-import

3 stars 2 forks source link

[MapServer-WMS]Server title element value in a context file is lost #885

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: nsavard@mapgears.com Date: 2004/09/22 - 19:21

Background information:
I modified the "context.cml" file found at
"http://schemas.opengis.net/context/1.0.0/context.cml" URL to include all
possible context elements specified within the "context.xsd" (could be found at
the same URL).  I opened this file in MapServer and saved this new map file as a
context file.  

Problem:
In the following input "context.cml" file snippet the server title element value
is "ESA CubeSERV" and the layer title element value is "WORLD_MODIS_1KM".  After
saving this context file the server "title" element value is the same as the
layer title value (see Output context file snippet).

------------------
Input context file snippet:

  <LayerList>
    <Layer queryable="1" hidden="0">
      <Server service="OGC:WMS" version="1.1.0" title="ESA CubeSERV">
        <OnlineResource xlink:type="simple"
xlink:href="http://mapserv2.esrin.esa.it/cubestor/cubeserv/cubeserv.cgi"/>
      </Server>
      <Name>WORLD_MODIS_1KM:MapAdmin</Name>
      <Title>WORLD_MODIS_1KM</Title>

-------------------------
Output context file:

  <LayerList>
    <Layer queryable="1" hidden="0">
      <Server service="WMS" version="1.1.0" title="WORLD_MODIS_1KM">
        <OnlineResource xlink:type="simple"
xlink:href="http://mapserv2.esrin.esa.it/cubestor/cubeserv/cubeserv.cgi"/>
      </Server>
      <Name>WORLD_MODIS_1KM:MapAdmin</Name>
      <Title>WORLD_MODIS_1KM</Title>
      <Abstract>Global maps derived from various Earth Observation sensors / WOR
tbonfort commented 12 years ago

Author: assefa Date: 2004/11/08 - 18:36

The problem is that the context parser looks for title element first in the 
layer and if not found, tries to get the title in the <Server> element. It 
save the reulst as wms_title metadata and uses this value when outputing a 
context. We may need to save 2 metadatas if the values of server and layer 
title are diffrent.

Set it to FUTURE. 
tbonfort commented 12 years ago

Author: tomkralidis Date: 2008/09/23 - 02:08 Norm: I can work on this one. Can you post a test case?

tbonfort commented 12 years ago

Author: nsavard Date: 2008/09/23 - 15:23 Tom: I'll look into this. It was a long time ago. A lot more grey hairs since then ...

tbonfort commented 12 years ago

Author: tomkralidis Date: 2009/01/28 - 15:42 Norm: can you post a testcase? Maybe a PHP mapscript?

tbonfort commented 12 years ago

Author: tomkralidis Date: 2009/01/28 - 16:30 Norm: I was able to reproduce the problem. Fixed in 58ecd0b51e4b4b685cf0cc9c899a9655cc8f98c4 (r8461). MAP.LAYER.METADATA.wms_server_title is now picked up by the parser and written out by the writer.

Here's an example to test the functionality:

#!/usr/bin/python

import mapscript
map = mapscript.mapObj('./config.map')
map.loadMapContext('./wmc100.xml')
map.saveMapContext('./wmc100.xml-out')

Can you test and confirm? Thx

tbonfort commented 12 years ago

Author: nsavard Date: 2009/01/28 - 17:26 Tom: Yes I'm checking this today. I'll let you know.

tbonfort commented 12 years ago

Author: nsavard Date: 2009/01/28 - 23:07 Tom, this is fixed.