Interface ICreateDataStore
Defines a command that creates a file-based data store on a given feature source
Inherited Members
Namespace: OSGeo.MapGuide.MaestroAPI.Commands
Assembly: OSGeo.MapGuide.MaestroAPI.dll
Syntax
public interface ICreateDataStore : ICommand, IFdoSpatialContext, IFdoSerializable
Remarks
This command is only supported on certain implementations of IServerConnection You can find out if the connection supports this command through the Capabilities
Examples
How to create a data store with a given schema
IServerConnection conn = ...;
FeatureSchema schema = new FeatureSchema("Default", "");
ClassDefinition cls = new ClassDefinition("MyClass", "");
cls.DefaultGeometryProperty = "GEOM";
//Add identity property KEY
cls.AddProperty(new DataPropertyDefinition("KEY", "")
{
DataType = DataPropertyType.Int32,
IsAutoGenerated = true,
IsReadOnly = true,
IsNullable = false
}, true);
//Add string property NAME
cls.AddProperty(new DataPropertyDefinition("NAME", "")
{
DataType = DataPropertyType.String,
Length = 255,
IsNullable = true,
IsReadOnly = false
});
//Add geometry property GEOM
cls.AddProperty(new GeometricPropertyDefinition("GEOM", "")
{
GeometricTypes = FeatureGeometricType.Point,
SpatialContextAssociation = "Default"
});
schema.AddClass(cls);
ICreateDataStore create = (ICreateDataStore)conn.CreateCommand((int)CommandType.CreateDataStore);
CoordinateSystemDefinitionBase coordSys = conn.CoordinateSystemCatalog.FindCoordSys("LL84");
create.FeatureSourceId = fsId;
create.CoordinateSystemWkt = coordSys.WKT;
create.Name = "Default";
create.ExtentType = OSGeo.MapGuide.ObjectModels.Common.FdoSpatialContextListSpatialContextExtentType.Dynamic;
create.FileName = "Test.sdf";
create.Provider = "OSGeo.SDF";
create.Schema = schema;
create.XYTolerance = 0.001;
create.ZTolerance = 0.001;
create.Execute();
Properties
| Improve this Doc View SourceFeatureSourceId
Gets or sets the Feature Source ID
Declaration
string FeatureSourceId { get; set; }
Property Value
Type | Description |
---|---|
System.String |
FileName
Gets or sets the file name for the data store
Declaration
string FileName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Provider
Gets or sets the FDO provider name
Declaration
string Provider { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Schema
Gets or sets the Feature Schema that models the structure of the data store
Declaration
FeatureSchema Schema { get; set; }
Property Value
Type | Description |
---|---|
FeatureSchema |
Methods
| Improve this Doc View SourceExecute()
Executes the command
Declaration
void Execute()