wiki:MapGuideRfc77

Version 2 (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.
///
/// The FDO provider name of the feature source.
    /// \param spatialContextName (String/string)
    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 Feature Service

Feature Service will be extended to add one method to apply a schema.

class MgFeatureService : public MgService 
{
PUBLISHED_API:
    /// \brief
    /// Creates or updates a feature schema within the DataStore. 
    ///
    /// \param resource (MgResourceIdentifier)
    /// A resource identifier referring to a feature source.
    /// \param schema
    /// Input schema to be created or updated.
    ///
    /// \return
    /// Returns nothing.
    ///
    virtual void ApplySchema(
                         MgResourceIdentifier* resource,
                         MgFeatureSchema* schema) = 0;
};

Changes to MgPropertyType

Many FDO data sources support decimal property type. Users can add a decimal property in a feature class in those datasources. However, class MgPropertyType doesn't define a decimal property type. So we will extend class MgPropertyType to add a new type name 'Decimal' so that method MgFeatureService::ApplySchema(...) can handle the decimal property.

class MgPropertyType
{
PUBLISHED_API:
    ......
    /////////////////////////////////////////////////// 
    /// \brief 
    /// Type name for a decimal property. 
    /// 
    /// \remarks 
    /// This property type name is currently used to 
    /// apply schema only. 
    static const int Decimal     =  15; 
};

Implications

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

Test Plan

Add unit tests for method MgFeatureService::ApplySchema(...) 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.