Changes between Version 1 and Version 2 of FdoWmsNotes


Ignore:
Timestamp:
Feb 14, 2008, 3:20:34 PM (16 years ago)
Author:
amorsell
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FdoWmsNotes

    v1 v2  
    11
    2 == Overriding WMS Settings for MapGuide Open Source Consumption ==
     2= Overriding WMS Settings for MapGuide Open Source Consumption =
    33
    44Configuration of WMS feature sources within MapGuide Open Source is generally done using one of the commercial (such as Autodesk MapGuide Studio) or open source (such as Webstudio) GUI's.  Unfortunately, these GUI's currently do not allow the overriding of configuration information used in the WMS requests.  Examples of these configuration options include:
     
    1010 * Displaying of multiple WMS layers in a single MapGuide layer
    1111
     12= Configuration Document =
    1213
     14This section describes how to create the configuration document for the MapGuide WMS feature source.
    1315
     16== Get the Capabilities Document ==
     17Before anything can be done, you should get the capabilities document for the WMS service. This document contains the list of all the layers and possible values that can be used for the configuration parameters. To do this: Start a web browser and go to the location http://<WMSServiceAddress>?service=wms&request=GetCapabilities
    1418
     19== Basic Configuration Document ==
     20This section describes a basic configuration document that configures and exposes a single WMS layer.
     21
     22Copy the following XML to a text editor.
     23
     24{{{
     25
     26<?xml version="1.0" encoding="UTF-8"?>
     27<DataStore xmlns:fdo="http://fdo.osgeo.org/schemas" xmlns:gml="http://www.opengis.net/gml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://fdo.osgeo.org/schemas" xsi:schemaLocation="http://fdo.osgeo.org/schemas FdoDocument.xsd">
     28  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://fdo.osgeo.org/schemas/feature/WMS" xmlns:fdo="http://fdo.osgeo.org/schemas" xmlns:WMS="http://fdo.osgeo.org/schemas/feature/WMS" elementFormDefault="qualified" attributeFormDefault="unqualified">
     29    <xs:element name="%FeatureClassName%" type="WMS:%FeatureClassName%" abstract="false" substitutionGroup="gml:_Feature">
     30      <xs:key name="%FeatureClassName%Key">
     31        <xs:selector xpath=".//%FeatureClassName%"/>
     32        <xs:field xpath="Id"/>
     33      </xs:key>
     34    </xs:element>
     35    <xs:complexType name="%FeatureClassName%" abstract="false">
     36      <xs:complexContent>
     37        <xs:extension base="gml:AbstractFeatureType">
     38          <xs:sequence>
     39            <xs:element name="Id">
     40              <xs:simpleType>
     41                <xs:restriction base="xs:string">
     42                  <xs:maxLength value="256"/>
     43                </xs:restriction>
     44              </xs:simpleType>
     45            </xs:element>
     46            <xs:element name="Image" type="fdo:RasterPropertyType" fdo:defaultImageXSize="800" fdo:defaultImageYSize="600">
     47              <xs:annotation>
     48                <xs:appinfo source="http://fdo.osgeo.org/schemas">
     49                  <fdo:DefaultDataModel organization="Row" bitsPerPixel="32" tileSizeX="100" tileSizeY="100"/>
     50                </xs:appinfo>
     51              </xs:annotation>
     52            </xs:element>
     53          </xs:sequence>
     54        </xs:extension>
     55      </xs:complexContent>
     56    </xs:complexType>
     57  </xs:schema>
     58  <SchemaMapping provider="OSGeo.WMS.3.1" name="WMS" xmlns="http://fdowms.osgeo.org/schemas">
     59    <complexType name="%FeatureClassName%">
     60      <RasterDefinition name="Image">
     61        <Format>PNG</Format>
     62        <Transparent>true</Transparent>
     63        <BackgroundColor>0xFFFFFF</BackgroundColor>
     64        <Time>current</Time>
     65        <Elevation>0</Elevation>
     66        <SpatialContext>EPSG:4326</SpatialContext>
     67        <Layer name="%LayerName%">
     68          <Style/>
     69        </Layer>
     70      </RasterDefinition>
     71    </complexType>
     72  </SchemaMapping>
     73</DataStore>
     74
     75}}}
     76
     77Substitute %!FeatureClassName% with a descriptive name of your choosing (do not use “.” in the name, and until you get this working it is best to keep it limited to ascii characters).
     78
     79Substitute %!LayerName% with the name of the WMS layer that you want to display. For example, if the following entry occurs in WMS capabilities document:
     80<Layer queryable="1" opaque="0" noSubsets="0">
     81    <Name>theLayerName</Name>
     82    <Title>The layer title</Title>
     83</Layer>
     84then substitute %!LayerName% with theLayerName.
     85
     86At the end of the document are the following configuration parameters that can be adjusted as appropriate:
     87 * Format – used to specify the image type.  The possible values here are in the WMS capabilities document in the GetMap section.  Do not include the “image/” part of the format here.  That is, if the desired format is specified in the WMS capabilities document as “image/png”, put “png” in the configuration document.
     88 * Transparent – if the WMS Service supports transparency then specifying true here will make the background of the returned image transparent.  This transparency is preserved in MapGuide so any layers that this WMS layer is placed over will show through the transparent regions.
     89 * !BackgroundColor – if the WMS Service supports specifying background colors, set the RGB value (e.g., 0xFFFFFF=white, 0x000000=black, 0x0000FF=blue, 0xFF0000=red, 0x00FF00=green), here for the color.
     90 * Time – time value of the desired WMS layers.
     91 * Elevation – elevation of the desired WMS layers.
     92 * !SpatialContext – the spatial reference system to be used for the map.  The list of possible values here are described in the WMS capabilities document. Typically EPSG:4326 will work.
     93 * Layer – the name of the layer and the style to apply to it.  The list of possible styles is listed in the WMS capabilities document. For example, if “visual” was a possible style for the layer then <Style>visual</Style> could be added.
     94
     95Once the substitutions have been made save the file.
    1596
    1697