MapServer / MapServer-import

3 stars 2 forks source link

[OGC Context] invalid Context output, no sequencing of child elements #863

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: thorne@dmsolutions.ca Date: 2004/09/13 - 18:09

There is a bug when an context file is outputed to the user from mapserver. If
the context inputted into mapserver is invalid. In this case if the child
elements are defined in the wrong sequence, from context.xsd. Mapserver will not
attempt to reorganize the sequence to produce a valid context output.

Garbage in Garbage out.
tbonfort commented 12 years ago

Author: thorne@dmsolutions.ca Date: 2004/09/14 - 15:30

I have looked into this further and found out that the output of the context is
resequenced. What is invalid with the output of the context file is that the
<MetadataURL> element is placed incorrectly.

For example:

INPUT Context:
==============
<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<ViewContext version="1.0.0" id="ogcContext001"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.opengis.net/context"
xsi:schemaLocation="http://www.opengis.net/context
http://schemas.opengis.net/context/1.0.0/context.xsd">
  <General>
    <Window width="400" height="300"/>
    <!-- Bounding box corners and spatial reference system -->
<!--    <BoundingBox SRS="EPSG:4326" minx="-75.507443" miny="37.510511"
maxx="-58.965298" maxy="49.900554"/>  -->
    <BoundingBox SRS="EPSG:4269" minx="-72.05" miny="39.86" maxx="-62.92"
maxy="46.72"/>
    <Title>Context Sequence Test 1 for MapServer</Title>
  </General>
  <!-- LayerList of Layer elements
       - implied order: bottom To Top
       first Layer element is bottom most layer in map view
       last Layer elements is op most layer in map view
  -->
  <LayerList>
<!-- Inland Water Features -->
    <Layer queryable="1"  hidden="0">
        <Server service="WMS" version="1.1.0" title="OGC:WMS">
          <OnlineResource xlink:type="simple"
xlink:href="http://ekman.csc.noaa.gov/wmsconnector/com.esri.wsit.WMSServlet/NSDI_Master?"/>
       </Server>
        <Name>15</Name>
         <Abstract>
           Testing Sequence!!!
         </Abstract>        
        <Title>NOAA CSC: Hydrography Canada</Title>
        <MetadataURL format="text/plain">
            <OnlineResource xlink:type="simple"
xlink:href="http://ekman.csc.noaa.gov/metadata/27.txt"/>
        </MetadataURL>         
        <SRS>EPSG:4269 EPSG:4326</SRS>
       <FormatList>
         <Format current="1">image/png</Format>
         <Format>image/gif</Format>
         <Format>image/jpeg</Format>
         <Format>image/wbmp</Format>
       </FormatList>
    </Layer>
  </LayerList>    
</ViewContext>

OUTPUT Context:
===============
<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<ViewContext version="1.0.0" id="ogcContext001"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.opengis.net/context"
xsi:schemaLocation="http://www.opengis.net/context
http://schemas.opengis.net/context/1.0.0/context.xsd">
  <General>
    <Window width="400" height="300"/>
    <!-- Bounding box corners and spatial reference system -->
    <BoundingBox SRS="EPSG:4269" minx="-72.050000" miny="39.860000"
maxx="-62.920000" maxy="46.720000"/>
    <!-- Title of Context -->
    <Title>Gulf of Maine Basemap</Title>
  </General>
  <!-- LayerList of Layer elements
       - implied order: bottom To Top
       first Layer element is bottom most layer in map view
       last Layer elements is op most layer in map view
  -->
  <LayerList>
    <Layer queryable="1" hidden="0">
      <Server service="WMS" version="1.1.0" title="NOAA CSC: Hydrography Canada">
        <OnlineResource xlink:type="simple"
xlink:href="http://ekman.csc.noaa.gov/wmsconnector/com.esri.wsit.WMSServlet/NSDI_Master?"/>
      </Server>
      <Name>15</Name>
      <Title>NOAA CSC: Hydrography Canada</Title>
      <Abstract>Testing Sequence!!!
         </Abstract>
      <SRS>EPSG:4269 EPSG:4326</SRS>
      <MetadataURL format="text/plain">
        <OnlineResource xlink:type="simple"
xlink:href="http://ekman.csc.noaa.gov/metadata/27.txt"/>
      </MetadataURL>
      <FormatList>
        <Format current="1">image/png</Format>
        <Format>image/gif</Format>
        <Format>image/jpeg</Format>
        <Format>image/wbmp</Format>
      </FormatList>

    </Layer>
  </LayerList>
</ViewContext>

Notice that the Abstract element is moved to the proper sequence but not
MetaDataURL. The proper order of the elements for Layer found in the xsd namespace:
http://schemas.opengis.net/context/1.0.0/context.xsd

<xs:complexType name="LayerType">
  <xs:sequence>
    <xs:element name="Server" type="context:ServerType"/>
    <xs:element name="Name" type="xs:string"/>
    <xs:element name="Title" type="xs:string"/>
    <xs:element name="Abstract" type="xs:string" minOccurs="0"/>
    <xs:element name="DataURL" type="context:URLType" minOccurs="0"/>
    <xs:element name="MetadataURL" type="context:URLType" minOccurs="0"/>
    <xs:element name="SRS" type="xs:string" minOccurs="0"/>
    <xs:element name="FormatList" type="context:FormatListType" minOccurs="0"/>
    <xs:element name="StyleList" type="context:StyleListType" minOccurs="0"/>
    <xs:element name="Extension" type="context:ExtensionType" minOccurs="0"/>
  </xs:sequence>
</xs:complexType>
tbonfort commented 12 years ago

Author: jlacroix Date: 2004/09/20 - 14:40

I changed the output location of the layer SRS parameter and of the General
DataURL parameter (from version 0.1.4). Both were misplaced in the mapcontext
output. DataURL is now after LogoURL and SRS after MetadataURL.

Marking as FIXED.

Change in CVS of both 4.3 and 4.2