Search Results for

    Show / Hide Table of Contents

    Interface IInsertFeatures

    Defines a command that inserts a feature into a Feature Source

    Inherited Members
    IFeatureCommand.FeatureSourceId
    IFeatureCommand.ClassName
    ICommand.Parent
    Namespace: OSGeo.MapGuide.MaestroAPI.Commands
    Assembly: OSGeo.MapGuide.MaestroAPI.dll
    Syntax
    public interface IInsertFeatures : IFeatureCommand, ICommand
    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 insert a feature that contains a string and geometry value

        IServerConnection conn = ...;
        IInsertFeatures insertCmd = (IInsertFeatures)conn.CreateCommand((int)CommandType.InsertFeatures);
        insertCmd.FeatureSourceId = "Library://My.FeatureSource";
        insertCmd.ClassName = "MyFeatureClass";
        MutableRecord insertRec = new MutableRecord();
        FixedWKTReader wktReader = new FixedWKTReader();
        insertRec.PutValue("Geometry", new GeometryValue(wktReader.Read("POINT (10 10)")));
        insertRec.PutValue("Name", new StringValue("Foo"));
        insertCmd.RecordToInsert = insertRec;
        InsertResult res = insertCmd.Execute();

    Properties

    | Improve this Doc View Source

    RecordToInsert

    The feature to insert

    Declaration
    IMutableRecord RecordToInsert { get; set; }
    Property Value
    Type Description
    IMutableRecord

    Methods

    | Improve this Doc View Source

    Execute()

    Executes the command. Any error during execution will be caught and stored in the Error property

    Declaration
    InsertResult Execute()
    Returns
    Type Description
    InsertResult

    The feature insert result

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2009 - 2022 Jackie Ng