Web API Reference | MapGuide Open Source

- Overview
- Modules
- Classes

# MgFeatureService Class Reference
[MgFeatureService]

Provides an abstraction layer for the storage and retrieval of feature data in a technology-independent way. The API lets you determine what storage technologies are available and what capabilities they have. Access to the storage technology is modeled as a connection. For example, you can connect to a file and do simple insertions or connect to a relational database and do transaction-based operations. More...

Inherits MgService.

List of all members.

## Public Member Functions
virtual void | CreateFeatureSource (MgResourceIdentifier *resource, MgFeatureSourceParams *sourceParams)=0
| Creates a feature source in the repository identified by the specified resource identifier, using the given feature source parameters.
virtual MgFeatureSchemaCollection * | DescribeSchema (MgResourceIdentifier *resource, CREFSTRING schemaName)=0
| Gets the definitions of one or more schema contained in the feature source. See Feature Schema .
virtual MgFeatureSchemaCollection * | DescribeSchema (MgResourceIdentifier *resource, CREFSTRING schemaName, MgStringCollection *classNames)=0
| Gets the definitions of one or more schemas contained in the feature source for particular classes. If the specified schema name or a class name does not exist, this method will throw an exception. See Feature Schema .
virtual STRING | DescribeSchemaAsXml (MgResourceIdentifier *resource, CREFSTRING schemaName)=0
| Gets the definition in XML format of a schema contained in the feature source. See Feature Schema .
virtual STRING | DescribeSchemaAsXml (MgResourceIdentifier *resource, CREFSTRING schemaName, MgStringCollection *classNames)=0
| Gets the definitions in XML format of one or more schemas contained in the feature source for particular classes. If the specified schema name or a class name does not exist, this method will throw an exception. See Feature Schema .
virtual MgByteReader * | DescribeWfsFeatureType (MgResourceIdentifier *featureSourceId, MgStringCollection *featureClasses)=0
| Retrieves schema information about a set of feature classes for a given feature source.
virtual MgByteReader * | EnumerateDataStores (CREFSTRING providerName, CREFSTRING partialConnString)=0
| This method enumerates all the providers and if they are FDO enabled for the specified provider and partial connection string.
virtual INT32 | ExecuteSqlNonQuery (MgResourceIdentifier *resource, CREFSTRING sqlNonSelectStatement)=0
| Executes SQL statements NOT including SELECT statements.
virtual MgSqlDataReader * | ExecuteSqlQuery (MgResourceIdentifier *resource, CREFSTRING sqlStatement)=0
| Executes the SQL SELECT statement on the specified feature source.
virtual MgByteReader * | GetCapabilities (CREFSTRING providerName)=0
| Gets the capabilities of an FDO Provider expressed in XML according to the FdoProviderCapabilities schema.
virtual MgClassDefinition * | GetClassDefinition (MgResourceIdentifier *resource, CREFSTRING schemaName, CREFSTRING className)=0
| Gets the class definition for the specified class. See Feature Schema .
virtual MgStringCollection * | GetClasses (MgResourceIdentifier *resource, CREFSTRING schemaName)=0
| Gets a list of the names of all classes available within a specified schema . See Feature Schema .
virtual MgStringCollection * | GetConnectionPropertyValues (CREFSTRING providerName, CREFSTRING propertyName, CREFSTRING partialConnString)=0
| Gets a set of connection values that are used to make connections to an FDO provider that permits multiple connections.
virtual MgByteReader * | GetFeatureProviders ()=0
| Gets a list of the available FDO providers together with other information such as the names of the connection properties for each provider. This information is in XML format according to the FeatureProviderRegistry schema.
virtual MgFeatureReader * | GetLockedFeatures (MgResourceIdentifier *resource, CREFSTRING className, MgFeatureQueryOptions *options)=0
| Gets the locked features.
virtual MgLongTransactionReader * | GetLongTransactions (MgResourceIdentifier *resource, bool bActiveOnly)=0
| Gets all available long transactions for the provider.
virtual MgByteReader * | GetSchemaMapping (CREFSTRING providerName, CREFSTRING partialConnString)=0
| This method returns all of the logical to physical schema mappings for the specified provider and partial connection string.
virtual MgStringCollection * | GetSchemas (MgResourceIdentifier *resource)=0
| Gets a list of the names of all of the schemas available in the feature source. See Feature Schema .
virtual MgSpatialContextReader * | GetSpatialContexts (MgResourceIdentifier *resource, bool bActiveOnly)=0
| Gets all of the spatial contexts available in the feature source or just the active one.
virtual MgByteReader * | GetWfsFeature (MgResourceIdentifier *featureSourceId, CREFSTRING featureClass, MgStringCollection *requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures)=0
| Retrieves feature information based on the supplied criteria.
virtual STRING | SchemaToXml (MgFeatureSchemaCollection *schema)=0
| Translates the FDO schema information in the provided MgFeatureSchemaCollection object into a string containing an XML representation of the schema definitions in the feature source. See Feature Schema .
virtual MgDataReader * | SelectAggregate (MgResourceIdentifier *resource, CREFSTRING className, MgFeatureAggregateOptions *options)=0
| Selects groups of features from a feature source and applies filters to each of the groups according to the criteria set in the MgFeatureAggregateOptions argument. If you want to apply the criteria to all features without grouping them, use the MgFeatureService::SelectFeatures Method . See Filters and expressions .
virtual MgFeatureReader * | SelectFeatures (MgResourceIdentifier *resource, CREFSTRING className, MgFeatureQueryOptions *options, CREFSTRING coordinateSystem)=0
| Selects features from a feature source according to the criteria set in the MgFeatureQueryOptions argument The criteria are applied to all of the features in the feature source. Use the coordinateSystem argument to set the target coordinate system if you want to transform. If you want to apply the criteria to a subset of the features, use MgFeatureService::SelectAggregate. See Filters and expressions .
virtual MgFeatureReader * | SelectFeatures (MgResourceIdentifier *resource, CREFSTRING className, MgFeatureQueryOptions *options)=0
| Selects features from a feature source according to the criteria set in the MgFeatureQueryOptions argument The criteria are applied to all of the features in the feature source. If you want to apply the criteria to a subset of the features, use MgFeatureService::SelectAggregate. See Filters and expressions .
virtual bool | SetLongTransaction (MgResourceIdentifier *featureSourceId, CREFSTRING longTransactionName)=0
| Set the active long transaction name for a feature source.
virtual bool | TestConnection (MgResourceIdentifier *resource)=0
| Connects to the feature source specified by the resource identifier and verifies that the feature source has been correctly configured and installed in the resource repository. See Connection To Feature Source .
virtual bool | TestConnection (CREFSTRING providerName, CREFSTRING connectionString)=0
| Connects to the Feature Provider specified in the connection string. See Connection To Feature Source .
virtual MgPropertyCollection * | UpdateFeatures (MgResourceIdentifier *resource, MgFeatureCommandCollection *commands, bool useTransaction)=0
| Executes the MgDeleteFeatures, MgInsertFeatures, MgUpdateFeatures, MgLockFeatures or MgUnlockFeatures commands contained in the given MgFeatureCommandCollection object.
virtual MgFeatureSchemaCollection * | XmlToSchema (CREFSTRING xml)=0
| Creates an MgFeatureSchemaCollection object using the XML schema provided.

## Detailed Description

Provides an abstraction layer for the storage and retrieval of feature data in a technology-independent way. The API lets you determine what storage technologies are available and what capabilities they have. Access to the storage technology is modeled as a connection. For example, you can connect to a file and do simple insertions or connect to a relational database and do transaction-based operations.

Remarks:
  The following use cases are supported:
  - Connection to a datastore. See MgFeatureService::GetFeatureProviders, MgFeatureService::GetConnectionPropertyValues, MgFeatureService::TestConnection Method (CREFSTRING, CREFSTRING) , and MgFeatureService::TestConnection Method (MgResourceIdentifier*) .
  - Description of the capabilities of the FDO provider providing access to the datastore. See MgFeatureService::GetProviderCapabilities.
  - Insertion, deletion, and update of feature data. See MgFeatureService::UpdateFeatures, MgInsertFeatures, MgDeleteFeatures, and MgUpdateFeatures.
  - Selection of feature data. See MgFeatureService::SelectFeatures and MgFeatureService::SelectAggregate.
  - Description of the schema used to store feature data. See MgFeatureService::DescribeSchema, MgFeatureService::DescribeSchemaAsXml, MgFeatureService::GetSchemas, MgFeatureService::SchemaToXml, MgFeatureService::GetClasses and MgFeatureService::GetClassDefinition. See also Feature Schema .
  - Creation of an SDF feature source to cache feature data from other datastores. See MgFeatureService::CreateFeatureSource. Using the latter requires describing the schema in the source datastore. Transporting the features from the source datastore requires selecting them from the source and inserting them in the target.
  - Execute SQL commands. See MgFeatureService::ExecuteSqlNonQuery and MgFeatureService::ExecuteSqlQuery.
  - Get the spatial contexts contained in the datastore. See MgFeatureService::GetSpatialContexts.

Comments or suggestions? Send us feedback.