<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to save the feature in featurelayer back to geometry service? in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-save-the-feature-in-featurelayer-back-to/m-p/217032#M5446</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Right now I have a feature in the featurelayer (the feature is stored in the Graphics collection), I want to save this feature into geometry service. Any suggestions on how to do this part? Thank you so much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Dec 2010 15:10:43 GMT</pubDate>
    <dc:creator>DanDong</dc:creator>
    <dc:date>2010-12-02T15:10:43Z</dc:date>
    <item>
      <title>How to save the feature in featurelayer back to geometry service?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-save-the-feature-in-featurelayer-back-to/m-p/217032#M5446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Right now I have a feature in the featurelayer (the feature is stored in the Graphics collection), I want to save this feature into geometry service. Any suggestions on how to do this part? Thank you so much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 15:10:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-save-the-feature-in-featurelayer-back-to/m-p/217032#M5446</guid>
      <dc:creator>DanDong</dc:creator>
      <dc:date>2010-12-02T15:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to save the feature in featurelayer back to geometry service?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-save-the-feature-in-featurelayer-back-to/m-p/217033#M5447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure I understand your question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Geometry Service do not have features and therefore do not have a concept of saving features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe there's confusion here. You can look at the following documentation: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000027000000.htm"&gt;http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000027000000.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 18:38:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-save-the-feature-in-featurelayer-back-to/m-p/217033#M5447</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2010-12-02T18:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to save the feature in featurelayer back to geometry service?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-save-the-feature-in-featurelayer-back-to/m-p/217034#M5448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm not sure I understand your question.&lt;BR /&gt;&lt;BR /&gt;Geometry Service do not have features and therefore do not have a concept of saving features.&lt;BR /&gt;&lt;BR /&gt;Maybe there's confusion here. You can look at the following documentation: &lt;A href="http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000027000000.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000027000000.htm&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Jennifer! I think I got you point. I made a mistake here. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, since I still can't find out how to save the data in a collection(featureset) into SDE, My friends suggested that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Create a layer in the mxd file, which serves as the layer to which drawn polygons will be inserted and have it published in the service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. create a new polygon, copy all points of the drawn polygon to the newly created polygon. Create a Graphic object, assign the newly polygon to the graphic's geometry property, assign values to the graphic's attributes, which can be known from the feature layer's LayerInfo attribute, and add the graphic object to the Graphics collection of the feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Call the feature layer's save function to save the feature back to the geometry service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;He thinks once a feature has been written to the service, it is also written to the SDE. So I did according to what he said. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
ESRI.ArcGIS.Client.Geometry.Polygon insertPolygon = new ESRI.ArcGIS.Client.Geometry.Polygon();&amp;nbsp; //create a new polygon
insertPolygon.Rings.Add(pPointCollection);&amp;nbsp; //copy all points of the drawn polygon to the newly created polygon
ESRI.ArcGIS.Client.FeatureLayer myFeatureLayer = MyMap.Layers["MyFeatureLayer"] as FeatureLayer; //declear a featurelayer

ESRI.ArcGIS.Client.Graphic insertGraphic = new ESRI.ArcGIS.Client.Graphic() //Create a Graphic object
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geometry = insertPolygon,&amp;nbsp;&amp;nbsp; //assign the newly polygon to the graphic's geometry property
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Attributes = myFeatureLayer.LayerInfo&amp;nbsp;&amp;nbsp;&amp;nbsp; //assign values to the graphic's attributes, which can be known from the feature layer's LayerInfo attribute&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };

myFeatureLayer.Graphics.Add(insertGraphic); //add the graphic object to the Graphics collection of the feature layer
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the last line of the codes, I think I have add this polygon and it's attribute to the featurelayer that I published in the service. So that should mean I have saved this polygon. I am not sure whether I am correct. What do you think? Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:36:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-save-the-feature-in-featurelayer-back-to/m-p/217034#M5448</guid>
      <dc:creator>DanDong</dc:creator>
      <dc:date>2021-12-11T10:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to save the feature in featurelayer back to geometry service?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-save-the-feature-in-featurelayer-back-to/m-p/217035#M5449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't think this code will compile&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&amp;nbsp; Attributes = myFeatureLayer.LayerInfo &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attributes is read-only you cannot change this instance but you can modify it's contents by&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;graphic.Attributes["fieldname"] = value;&lt;/PRE&gt;&lt;SPAN&gt;Also the types do not match. Attributes is of type IDictionary&amp;lt;string, object&amp;gt; &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Graphic~Attributes.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Graphic~Attributes.html&lt;/A&gt;&lt;SPAN&gt; and LayerInfo is of type FeatureLayerInfo &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureService.FeatureLayerInfo.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.FeatureService.FeatureLayerInfo.html&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Post #10 in this thread might help &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/15718-failed-to-show-attribute-window-when-add-new-feature-by-selecting-from-another-layer" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/15718-failed-to-show-attribute-window-when-add-new-feature-by-selecting-from-another-layer&lt;/A&gt;&lt;SPAN&gt;. Note that this will only work if the field is nullable. I think it's best to know the type of the field and default value for the type. &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Field_members.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Field_members.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
foreach (var field in Layer.LayerInfo.Fields)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // check field properties here (Editable / Nullable/ Type) 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //so you can decide what value to give each attribute
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By the way, how are you getting "pPointCollection" ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since you already have a feature layer that updates features in your feature service. Would it not be easier to use TemplatePicker to draw and add the features?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:36:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/how-to-save-the-feature-in-featurelayer-back-to/m-p/217035#M5449</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T10:36:51Z</dc:date>
    </item>
  </channel>
</rss>

