<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"        "http://www.w3.org/TR/html4/loose.dtd">
<html>
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
                <title>Web API Reference</title>
                <link href="../../custom.css" rel="stylesheet" type="text/css">
                <link href="../../tabs.css" rel="stylesheet" type="text/css">
        </head>
        <body bgcolor="#FFFFFF">
                <table width="100%"  border="0">
                        <tr>
                                <td><b>Web API Reference</b></td>
                                <td align="right"><b>MapGuide Open Source</b></td>
                        </tr>                        
                </table>
<!-- End of: MgOpenSource_header.html -->
<!-- Generated by Doxygen 1.4.5 -->
<div class="tabs">
  <ul>
    <li><a href="../../main.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="../../modules.html"><span>Modules</span></a></li>
    <li><a href="../../namespaces.html"><span>Namespaces</span></a></li>
    <li id="current"><a href="../../annotated.html"><span>Classes</span></a></li>
    <li><a href="../../files.html"><span>Files</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="../../annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="../../classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="../../hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="../../functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<h1>MgInsertFeatures Class Reference</h1><!-- doxytag: class="MgInsertFeatures" --><!-- doxytag: inherits="MgFeatureCommand" -->Inherits <a class="el" href="../../d6/dae/class_mg_feature_command.html">MgFeatureCommand</a>.
<p>
Inheritance diagram for MgInsertFeatures:<p><center><img src="../../d5/d93/class_mg_insert_features__inherit__graph.png" border="0" usemap="#d4/d45/_mg_insert_features__inherit__map" alt="Inheritance graph"></center>
<map name="d4/d45/_mg_insert_features__inherit__map">
<area href="../../d6/dae/class_mg_feature_command.html" shape="rect" coords="7,7,156,34" alt="">
</map>
<center><font size="2">[<a target="top" href="../../graph_legend.html">legend</a>]</font></center><a href="../../d1/d79/class_mg_insert_features-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
Creates an insert feature data command. You must add this command to an <a class="el" href="../../d3/d04/class_mg_feature_command_collection.html">MgFeatureCommandCollection</a> object and pass the latter in a call to <a class="el" href="../../d5/d10/class_mg_feature_service_278b25e5af6145f091457701fec788dd.html#278b25e5af6145f091457701fec788dd">MgFeatureService::UpdateFeatures</a>. 
<p>
<dl compact><dt><b>Remarks:</b></dt><dd>If you inserting one feature, you can create the command using the <a class="el" href="../../d4/d63/class_mg_insert_features_d36f211587067112f6f3d1c78b1c543e.html#d36f211587067112f6f3d1c78b1c543e">MgInsertFeatures::MgInsertFeatures Constructor (CREFSTRING, MgPropertyCollection*) </a>. If you are inserting many features, you can create the command using the <a class="el" href="../../d4/d63/class_mg_insert_features_d36f211587067112f6f3d1c78b1c543e.html#d36f211587067112f6f3d1c78b1c543e">MgInsertFeatures::MgInsertFeatures Constructor (CREFSTRING, MgBatchPropertyCollection*) </a>. <br>
 <b>Procedure</b> <ol>
<li>
Get the property definitions for the class. See <a class="el" href="../../db/dcf/class_mg_class_definition_7c89833a76381c4300c2888bf85d4729.html#7c89833a76381c4300c2888bf85d4729">MgClassDefinition::GetProperties Method </a>. As a minimum, you must create property values for each of the properties defined as mandatory. See <a class="el" href="../../d6/d5b/class_mg_data_property_definition_ddcc1321e546115b49eb8aa077727d2c.html#ddcc1321e546115b49eb8aa077727d2c">MgDataPropertyDefinition::GetNullable Method </a> and <a class="el" href="../../d3/d2a/class_mg_raster_property_definition_ddcc1321e546115b49eb8aa077727d2c.html#ddcc1321e546115b49eb8aa077727d2c">MgRasterPropertyDefinition::GetNullable Method </a>. </li>
<li>
Create a property object for each property value appropriate to the type of the value; for example, use the <a class="el" href="../../da/d8a/class_mg_geometry_property.html">MgGeometryProperty</a> class to create an object containing a geometry value and use the <a class="el" href="../../d0/d12/class_mg_boolean_property.html">MgBooleanProperty</a> class to create an object containing a boolean value; the property class constructor is passed the name of the property and its value. See <a class="el" href="../../df/d88/group___feature___properties___module.html">Feature Properties </a>. </li>
<li>
Add each property object to an <a class="el" href="../../d3/dec/class_mg_property_collection.html">MgPropertyCollection</a> object  </li>
<li>
Create the insert command <ol>
<li>
Pass the class name and the property collection to the <a class="el" href="../../d4/d63/class_mg_insert_features_d36f211587067112f6f3d1c78b1c543e.html#d36f211587067112f6f3d1c78b1c543e">MgInsertFeatures::MgInsertFeatures Constructor (CREFSTRING, MgPropertyCollection*) </a> and go on to step 5, or </li>
<li>
Add the <a class="el" href="../../d3/dec/class_mg_property_collection.html">MgPropertyCollection</a> object to an <a class="el" href="../../d7/d5f/class_mg_batch_property_collection.html">MgBatchPropertyCollection</a> object, and </li>
<li>
Create and add <a class="el" href="../../d3/dec/class_mg_property_collection.html">MgPropertyCollection</a> objects to the batch property collection for all of the features that you want to add, and </li>
<li>
Pass the class name and batch property collection to the <a class="el" href="../../d4/d63/class_mg_insert_features_d36f211587067112f6f3d1c78b1c543e.html#d36f211587067112f6f3d1c78b1c543e">MgInsertFeatures::MgInsertFeatures Constructor (CREFSTRING, MgBatchPropertyCollection*) </a> and go on to step 5 </li>
</ol>
</li>
<li>
Add the MgInsertFeatures object to an <a class="el" href="../../d3/d04/class_mg_feature_command_collection.html">MgFeatureCommandCollection</a> object. </li>
<li>
Execute the MgFeatureServices::UpdateFeatures() method; the arguments are a resource identifier for the feature source and the <a class="el" href="../../d3/d04/class_mg_feature_command_collection.html">MgFeatureCommandCollection</a> object. </li>
<li>
Check the result. The result is an <a class="el" href="../../d3/dec/class_mg_property_collection.html">MgPropertyCollection</a> object. 1. For each insert command constructed with an <a class="el" href="../../d3/dec/class_mg_property_collection.html">MgPropertyCollection</a> object argument, there will be one property of type <a class="el" href="../../d1/d70/class_mg_property_type_21021ea0e52be8e9c599f4dff41e5be0.html#21021ea0e52be8e9c599f4dff41e5be0">MgPropertyType::Feature</a> in the collection. This property is an <a class="el" href="../../d6/ddc/class_mg_feature_reader.html">MgFeatureReader</a> object containing the properties that were inserted. </li>
</ol>
<br>
 The following illustration shows the relationships among the classes used in creating the arguments for a call to <a class="el" href="../../d5/d10/class_mg_feature_service_278b25e5af6145f091457701fec788dd.html#278b25e5af6145f091457701fec788dd">MgFeatureService::UpdateFeatures()</a>, which contains one insertion command: <div align="center">
<img src="../../InsertFeatures.png" alt="InsertFeatures.png">
</div>
 </dd></dl>

<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">INT32&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d63/class_mg_insert_features_e5f7f9405cf1bcfd9b4846551af26d4c.html#e5f7f9405cf1bcfd9b4846551af26d4c">GetCommandType</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets the type of the command, that is, <a class="el" href="../../db/d64/class_mg_feature_command_type_9c4e9a491218b7efdaf652127e3c433b.html#9c4e9a491218b7efdaf652127e3c433b">MgFeatureCommandType::InsertFeatures</a>.  <a href="#e5f7f9405cf1bcfd9b4846551af26d4c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">STRING&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d63/class_mg_insert_features_0dffe11b13b8112d7a8bc03421643e0f.html#0dffe11b13b8112d7a8bc03421643e0f">GetFeatureClassName</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets the feature class name specified in the constructor.  <a href="#0dffe11b13b8112d7a8bc03421643e0f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="../../d3/dec/class_mg_property_collection.html">MgPropertyCollection</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d63/class_mg_insert_features_e2042d62eb7692315a826462a9278652.html#e2042d62eb7692315a826462a9278652">GetPropertyValues</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Gets the collection of property values specified in <a class="el" href="../../d4/d63/class_mg_insert_features_d36f211587067112f6f3d1c78b1c543e.html#d36f211587067112f6f3d1c78b1c543e">MgInsertFeatures::MgInsertFeatures Constructor (CREFSTRING, MgPropertyCollection*) </a>.  <a href="#e2042d62eb7692315a826462a9278652"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d63/class_mg_insert_features_ebce186833e1b4eb0a6f2cbacc052427.html#ebce186833e1b4eb0a6f2cbacc052427">MgInsertFeatures</a> (CREFSTRING className, <a class="el" href="../../d7/d5f/class_mg_batch_property_collection.html">MgBatchPropertyCollection</a> *propertyValueCollection)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs an insert command containing many features.  <a href="#ebce186833e1b4eb0a6f2cbacc052427"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d63/class_mg_insert_features_d36f211587067112f6f3d1c78b1c543e.html#d36f211587067112f6f3d1c78b1c543e">MgInsertFeatures</a> (CREFSTRING className, <a class="el" href="../../d3/dec/class_mg_property_collection.html">MgPropertyCollection</a> *propertyValues)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs an insert command containing one feature.  <a href="#d36f211587067112f6f3d1c78b1c543e"></a><br></td></tr>
</table>
<!-- MgOpenSource_footer.html -->        
                <!-- 
                <hr>
                *** Not currently used.  Need new address. ***                
                
                <table width="100%"  border="0">
                        <tr>
                                <td>Comments or suggestions? Send us 
                                    <a href="mailto:docfeedback@osgeo.org&subject=MapGuide%20Web%20API%20documentation">
                                    feedback</a>.
                                </td>
                                [[The logo can go in another cell, when we get one]]                
                        </tr>
                </table>
                -->
                <hr>
        </body>
</html>