wiki:MapGuideRfc106

MapGuide RFC 106 - OGC WFS 1.1.0 Support

This page contains an change request (RFC) for the MapGuide Open Source project. More MapGuide RFCs can be found on the RFCs page.

Status

RFC Template Version(1.0)
Submission Date07/22/2010
Last ModifiedArthur Liu 07/22/2010
AuthorArthur Liu
RFC Statusimplemented
Implementation Statusimplemented
Proposed Milestone2.3
Assigned PSC guide(s)Bruce Dechant
Voting HistoryAug 9, 2010
+1Tom, Jackie, Jason, Bruce, Zac, Haris
+0
-0
-1
no vote Bob, Paul, Trevor

Overview

Enhance the WFS 1.1.0 implmentation of MapGuide according to OGC WFS 1.1.0 specification. The goal is to make sure MapGuide could pass the OGC certification for WFS 1.1.0 and 1.0.0 (http://cite.opengeospatial.org).

Motivation

OGC WFS 1.1.0 specification has been released for years, however, the offical supported WFS version for MapGuide is stay 1.0.0. It is necessary for MapGuide to enhance the implementation to support WFS 1.1.0.

Proposed Solution

1) Enhance the GetFeatureType operation to support namespacePrefix and namespaceUrl

In order to pass the OGC certification, MapGuide should have the capability to support user-defnied namespacePrefix and namespaceUrl in the generated GML files.

A new DescribeWfsFeature API should be added to handle namespacePrefix and namespaceUrl

    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// \brief
    /// Retrieves schema informationabout a set of feature classes for a given feature source with specified namespace prefix and url.
    ///
    /// <!-- Syntax in .Net, Java, and PHP -->
    /// \htmlinclude DotNetSyntaxTop.html
    /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string namespacePrefix, string namespaceUrl);
    /// \htmlinclude SyntaxBottom.html
    /// \htmlinclude JavaSyntaxTop.html
    /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string namespacePrefix, string namespaceUrl);
    /// \htmlinclude SyntaxBottom.html
    /// \htmlinclude PHPSyntaxTop.html
    /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string namespacePrefix, string namespaceUrl);
    /// \htmlinclude SyntaxBottom.html
    ///
    /// \param featureSourceId (MgResourceIdentifier)
    /// The resource identifier defining the
    /// location of the feature source in
    /// the repository.
    /// \param featureClasses (MgStringCollection)
    /// A collection of strings identifying the feature classes for which to
    /// retrieve schema information. If this collection is null or empty, information
    /// is returned for all feature classes.
    /// \param namespacePrefix (String/string)
    /// A string identifying the namespace prefix in the output xml
    /// \param namespaceUrl (String/string)
    /// A string idenyifying the namespace url in the output xml
    ///
    /// \return
    /// Returns an MgByteReader containing the XML schema.
    ///
    virtual MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId,
                                                 MgStringCollection* featureClasses,
                                                 CREFSTRING namespacePrefix,
                                                 CREFSTRING namespaceUrl);

HttpWfsGetFeatureType should be enhanced to obtain namespace prefix and url, and invoke the new API DescribeWfsFeatureType with these parameters

    void MgHttpWfsDescribeFeatureType::Execute(MgHttpResponse& hResponse)
    {
        ......
        
        Ptr<MgByteReader> response  = pFeatureService->DescribeWfsFeatureType(&idResource,pFeatureClasses,sPrefix, sUrl);
        
        ......
    }

2) Enhance the GetFeature operation to support mutiple GML formats

In WFS 1.1.0 specification section 9.2: The optional output format attribute specifies the format of the response to a GetFeature request. The default value is text/xml;subtype=gml/3.1.1 indicating that a vald GML3 document, that validate s against a valid GML3 application schema, must be generated. For backward compatibility, the value GML2 may be specified indicating that a valid GML2 document, that validates against a valid GML2 application schema, must be generated. So,it is necessary for MapGuide to enhance the HttpWfsGetFeature to handle different GML formats. Same as DescribeWfsFeatureType, namespacePrefix and namespaceUrl are also needed for OGC certification.

A new GetWfsFeature API should be added to handle the output GML format

        ////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// \brief
    /// Retrieves feature information based on the supplied criteria with specified format.
    ///
    /// \note1
    ///
    /// <!-- Syntax in .Net, Java, and PHP -->
    /// \htmlinclude DotNetSyntaxTop.html
    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
    /// \htmlinclude SyntaxBottom.html
    /// \htmlinclude JavaSyntaxTop.html
    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
    /// \htmlinclude SyntaxBottom.html
    /// \htmlinclude PHPSyntaxTop.html
    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat, string sortCriteria, string namespacePrefix, string namespaceUrl);
    /// \htmlinclude SyntaxBottom.html
    ///
    /// \param featureSourceId (MgResourceIdentifier)
    /// The resource identifier defining the
    /// location of the feature source in
    /// the repository.
    /// \param featureClass (String/string)
    /// The feature class containing the features to retrieve.
    /// \param requiredProperties (MgStringCollection)
    /// The collection of properties to retrieve for each feature. If the
    /// collection is null or empty, all properties will be retrieved.
    /// \param srs (String/string)
    /// The spatial reference system in which to return feature geometries
    /// \param filter (String/string)
    /// An XML string containing the definition for an OGC filter
    /// \param maxFeatures (int)
    /// The maximum number of features to retrieve. If the value is less
    /// than or equal to zero, all features will be retrieved.
    /// \param wfsVersion (String/string)
    /// A string identifying the wfs version
    /// \param outputFormat (String/string)
    /// A string identifying the output format of
    /// the retrieved feature information.
    /// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 9.2
    /// http://portal.opengeospatial.org/files/?artifact_id=8339
    /// \param sortCriteria (String/string)
    /// A string identifying the sort criteria
    /// \param namespacePrefix (String/string)
    /// A string identifying the namespace prefix in the output xml
    /// \param namespaceUrl (String/string)
    /// A string idenyifying the namespace url in the output xml
    ///
    /// \return
    /// Returns an MgByteReader containing the requested feature information.
    ///
    /// \exception MgInvalidArgumentException
    ///
    virtual MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId,
                                        CREFSTRING featureClass,
                                        MgStringCollection* requiredProperties,
                                        CREFSTRING srs,
                                        CREFSTRING filter,
                                        INT32 maxFeatures,
                                        CREFSTRING wfsVersion,
                                        CREFSTRING outputFormat,
                                        CREFSTRING sortCriteria,
                                        CREFSTRING namespacePrefix,
                                        CREFSTRING namespaceUrl) = 0;

HttpWfsGetFeature should be enhanced to obtain the output GML format and invoke the new API GetWfsFeature with outputFormat parameter

    void MgHttpWfsGetFeature::AcquireResponseData(MgOgcServer* ogcServer)
    {
        ......
        
        
        Ptr<MgByteReader> resultReader = featureService->GetWfsFeature(featureSourceId, ((sSchemaHash.size()==0) ? sClass : sSchemaHash + _(":") + sClass),
                                requiredProperties, m_getFeatureParams->GetSrs(), filter, numFeaturesToRetrieve-1, sVersion, sOutputFormat, sSortCriteria, sPrefix, oFeatureTypes.GetNamespaceUrl());
        
        ......
    }


Implications

Besides OGC WFS 1.1.0, MapGuide also support WFS 1.0.0. This enhancement should not affect the functionality of previous version.

Test Plan

After the implementation of OGC WFS 1.1.0 enhancement, an official OGC certification(http://cite.opengeospatial.org) will test if MapGuide provides standard WFS service.

Funding/Resources

Supplied by Autodesk.

Relevant Ticket

Ticket #1421

Last modified 7 years ago Last modified on Apr 7, 2011 2:22:16 AM