wiki:MapGuideRfc77

Version 9 (modified by leaf, 15 years ago) ( diff )

--

MapGuide RFC 77 - Create Feature Source

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 DateJuly 09, 2009
Last ModifiedLeaf Li Timestamp
AuthorLeaf Li
RFC Statusdraft
Implementation Statusunder development
Proposed Milestone2.2
Assigned PSC guide(s)Bruce Dechant
Voting History(vote date)
+1
+0
-0
-1
no vote

Overview

This proposal is to extend MapGuide Feature Service to support creating more types of feature source.

Motivation

Currently method MgFeatureService::CreateFeatureSource() supports creating a SDF feature source only. It is really a limitation of Feature Service. This RFC will extend this method to support all file based feature sources.

Proposed Solution

MgFileFeatureSourceParams

A new class MgFileFeatureSourceParams is added to represent parameters which are used to create a file-based feature source. The existing class MgCreateSdfParams inherits from it. Previously MgCreateSdfParams inherits from virtual base class MgFeatureSourceParams directly as shown in the following picture.

The class definition of MgFileFeatureSourceParams is as follows.

///////////////////////////////////////////////
/// \brief
/// Contains the parameters used to create an file-based
/// feature source.
///
class MgFileFeatureSourceParams : public MgFeatureSourceParams
{
PUBLISHED_API:
    ///////////////////////////////////////////////
    /// \brief
    /// Constructs an empty MgFileFeatureSourceParams object.
    ///
    /// \param providerName (String/string)
    /// The FDO provider name of the feature source.
    ///
    /// \return
    /// Returns nothing.
    ///
    MgFileFeatureSourceParams (CREFSTRING providerName);
    
    ///////////////////////////////////////////////
    /// \brief
    /// Constructs an MgFileFeatureSourceParams object with the supplied
    /// parameters.
    ///
    /// \param providerName (String/string)
    /// FDO provider name of the feature source to be created.
    /// \param spatialContextName (String/string)
    /// The name of the spatial context. This is a user defined spatial
    /// context for the file feature source.
    /// \param srsWkt (String/string)
    /// An OGC WKT string representing the coordinate system for the file
    /// feature source.
    /// \param featureSchema (MgFeatureSchema)
    /// The schema definition for the file feature source.
    ///
    /// \return
    /// Returns nothing.
    ///
    MgFileFeatureSourceParams (
        CREFSTRING providerName, 
        CREFSTRING spatialContextName, 
        CREFSTRING srsWkt, 
        MgFeatureSchema* featureSchema);

    ///////////////////////////////////////////////
    /// \brief
    /// Gets the FDO provider name of the feature source.
    ///
    /// \return
    /// Returns the FDO provider name of the feature source.
    ///
    virtual STRING GetProviderName();  /// __get

    ///////////////////////////////////////////////
    /// \brief
    /// Gets the file name to be created or the folder name where files are created.
    ///
    /// \return
    /// Returns the file name to be created or the folder name where files are created.
    ///
    STRING GetFileOrFoldName();  /// __get, __set

    ////////////////////////////////////////////////////////////////////////////
    /// \brief
    /// Sets the file name to be created or the folder name where files are created.
    ///
    /// \param name (String/string)
    /// The file name to be created or the folder name where files are created.
    ///
    /// \return
    /// Returns nothing.
    ///
    void Set GetFileOrFoldName (CREFSTRING name);

    ///////////////////////////////////////////////
    /// \brief
    /// Gets the user-defined spatial context name.
    ///
    /// \return
    /// Returns the name of the spatial context.
    ///
    STRING GetSpatialContextName();  /// __get, __set

    ////////////////////////////////////////////////////////////////////////////
    /// \brief
    /// Sets the user-defined spatial context name.
    ///
    /// \param name (String/string)
    /// The name of the spatial context
    ///
    /// \return
    /// Returns nothing.
    ///
    void SetSpatialContextName(CREFSTRING name);

    /////////////////////////////////////////////
    /// \brief
    /// Gets the spatial context description.
    ///
    /// \return
    /// Returns the spatial context description.
    ///
    STRING GetSpatialContextDescription();  /// __get, __set

    //////////////////////////////////////////////////////////////////////////
    /// \brief
    /// Sets the spatial context description.
    /// \param description (String/string)
    /// The description of the spatial context.
    ///
    /// \return
    /// Returns nothing.
    ///
    void SetSpatialContextDescription(CREFSTRING description);

    ///////////////////////////////////////////////////////////////
    /// \brief
    /// Gets the well-known text description of the coordinate system.
    ///
    /// \return
    /// Returns the OGC WKT description of the coordinate system.
    ///
    STRING GetCoordinateSystemWkt();  /// __get, __set

    //////////////////////////////////////////////////////////////////////////
    /// \brief
    /// Sets the well-know text string representing the coordinate system.
    ///
    /// \param srsWkt (String/string)
    /// The OGC WKT string representing the coordinate system.
    ///
    /// \return
    /// Returns nothing.
    ///
    void SetCoordinateSystemWkt(CREFSTRING srsWkt);

    //////////////////////////////////////////////////////////
    /// \brief
    /// Gets the tolerance tolerance used for the X and Y
    /// ordinates.
    ///
    /// \return
    /// Returns the tolerance used for the X and Y ordinates.
    ///
    double GetXYTolerance();  /// __get, __set

    ////////////////////////////////////////////////////////////////
    /// \brief
    /// Sets the tolerance tolerance for the X and Y ordinates.
    ///
    /// \param tolerance (double)
    /// The tolerance for the X and Y ordinates.
    ///
    /// \return
    /// Returns nothing.
    ///
    void SetXYTolerance(double tolerance);

    ////////////////////////////////////////////////////////
    /// \brief
    /// Gets the tolerance tolerance for the Z ordinate.
    ///
    /// \return
    /// Returns the tolerance for the Z ordinate.
    ///
    double GetZTolerance();  /// __get, __set

    ////////////////////////////////////////////////////////////////////////////
    /// \brief
    /// Sets the tolerance for the Z ordinate.
    ///
    /// \param tolerance (double)
    /// The tolerance for the Z ordinate.
    ///
    /// \return
    /// Returns nothing.
    ///
    void SetZTolerance(double tolerance);

    ////////////////////////////////////////////////
    /// \brief
    /// Gets the feature schema definition.
    ///
    /// \return
    /// Returns a feature schema definition object.
    ///
    MgFeatureSchema* GetFeatureSchema();  /// __get, __set

    ///////////////////////////////////////////////////////////////////
    /// \brief
    /// Sets the feature schema definition.
    ///
    /// \param featureSchema (MgFeatureSchema)
    /// The feature schema definition.
    ///
    /// \return
    /// Returns nothing.
    ///
    void SetFeatureSchema(MgFeatureSchema* featureSchema);
};

Changes to MgCreateSdfParams

/// \brief
/// Contains the parameters used to create an SDF feature source.
///
class MgCreateSdfParams : public MgFileFeatureSourceParams
{
PUBLISHED_API:
    //////////////////////////////////////////////////
    /// \brief
    /// Constructs an empty MgCreateSdfParams object.
    ///
    /// \return
    /// Returns nothing.
    ///
    MgCreateSdfParams();

    ////////////////////////////////////////////////////
    /// \brief
    /// Constructs an MgCreateSdfParams object with the supplied
    /// parameters.
    ///
    /// \param spatialContextName (String/string)
    /// The name of the spatial context. This is a user defined
    /// spatial context for the SDF file. Only one spatial context is
    /// supported.
    /// \param srsWkt (String/string)
    /// An OGC WKT string representing the
    /// coordinate system for the SDF file.
    /// \param featureSchema (MgFeatureSchema)
    /// The schema definition for the SDF file.
    ///
    /// \return
    /// Returns nothing.
    ///
    MgCreateSdfParams(
        CREFSTRING spatialContextName, 
        CREFSTRING srsWkt, 
        MgFeatureSchema* featureSchema);

    ///////////////////////////////////////////////
    /// \brief
    /// Gets the FDO provider name of the feature source.
    ///
    /// \return
    /// Returns the FDO provider name of the feature source.
    ///
    virtual STRING GetProviderName();  /// __get
};

There are no change to method MgFeatureService::CreateFeatureSource(), whose usage is as before.

Implications

This is new API only. There will be no effect on existing applications. However, API documentation need to be updated.

Currently, there is no enough resources and funding to support creating non-file based feature sources. They may be implemented if resources and funding can be obtained in the future.

Test Plan

Add unit tests for method MgFeatureService::CreateFeatureSource(...) into the existing Feature Service unit tests.

Funding/Resources

Supplied by Autodesk.

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.