<?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 Re: Maintain graphic attributes when it is reprojected in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintain-graphic-attributes-when-it-is-reprojected/m-p/368859#M9521</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can use the 3rd parameter userToken of ProjectAsync like so:&lt;BR /&gt;_geometryService.ProjectAsync(new List&amp;lt;Graphic&amp;gt;() {&amp;nbsp; projectedGraphic&amp;nbsp; }, new SpatialReference(4326), projectedGraphic);&lt;BR /&gt;and in the Completed event, you can retrieve graphic with attributes through the UserState:&lt;BR /&gt; void geometryService_ProjectCompleted(object sender, GraphicsEventArgs e)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Graphic projectedGraphic&amp;nbsp; = e.UserState as Graphic;&lt;BR /&gt;// TODO: complete project completed logic here.&lt;BR /&gt;}&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However this works only if you are projecting one geometry. If you pass more of them then you have to add a collection of attributes and then somehow match the correct geometry with the correct attribute value when the projection result is retrieved (assuming that geometries are returned in the same order).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, I'm a bit confused why instead of taking Geometries it takes Graphics as an argument if it doesn't return back the Graphic.Attributes property. So when you want to re-project a geometry, you have to wrap it inside a Graphic, put it in a collection and then retrieve it back when you get a result. Maybe someone knows why it is done this way and maybe there actually is a way to maintain the Attributes inside a Graphic?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Dec 2010 14:51:54 GMT</pubDate>
    <dc:creator>tAndriusBogvila</dc:creator>
    <dc:date>2010-12-30T14:51:54Z</dc:date>
    <item>
      <title>Maintain graphic attributes when it is reprojected</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintain-graphic-attributes-when-it-is-reprojected/m-p/368857#M9519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the ESRI Silverlight API to reproject a graphic into GCS_WGS_1984.&amp;nbsp; The graphic has a single mappoint as it's geometry property.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the code I am using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;
//mp contains the MapPoint geometry
Graphic projectedGraphic = new Graphic() { Geometry = mp };
projectedGraphic.Attributes.Add("MyAttribute", "Data");

_geometryService.ProjectAsync(new List&amp;lt;Graphic&amp;gt;() {&amp;nbsp; projectedGraphic&amp;nbsp; }, new SpatialReference(4326));&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The graphic reprojects correctly, however the resulting graphic does not contain the attribute that I previously had assigned.&amp;nbsp; Is there any way to maintain this attribute across a reprojection?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Seth&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Sep 2010 14:27:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintain-graphic-attributes-when-it-is-reprojected/m-p/368857#M9519</guid>
      <dc:creator>SethPatrich</dc:creator>
      <dc:date>2010-09-20T14:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Maintain graphic attributes when it is reprojected</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintain-graphic-attributes-when-it-is-reprojected/m-p/368858#M9520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can use the 3rd parameter userToken of ProjectAsync like so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_geometryService.ProjectAsync(new List&amp;lt;Graphic&amp;gt;() {&amp;nbsp; projectedGraphic&amp;nbsp; }, new SpatialReference(4326), projectedGraphic);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and in the Completed event, you can retrieve graphic with attributes through the UserState:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; void geometryService_ProjectCompleted(object sender, GraphicsEventArgs e)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Graphic projectedGraphic&amp;nbsp; = e.UserState as Graphic;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// TODO: complete project completed logic here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 09:50:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintain-graphic-attributes-when-it-is-reprojected/m-p/368858#M9520</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2010-09-23T09:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Maintain graphic attributes when it is reprojected</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintain-graphic-attributes-when-it-is-reprojected/m-p/368859#M9521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can use the 3rd parameter userToken of ProjectAsync like so:&lt;BR /&gt;_geometryService.ProjectAsync(new List&amp;lt;Graphic&amp;gt;() {&amp;nbsp; projectedGraphic&amp;nbsp; }, new SpatialReference(4326), projectedGraphic);&lt;BR /&gt;and in the Completed event, you can retrieve graphic with attributes through the UserState:&lt;BR /&gt; void geometryService_ProjectCompleted(object sender, GraphicsEventArgs e)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Graphic projectedGraphic&amp;nbsp; = e.UserState as Graphic;&lt;BR /&gt;// TODO: complete project completed logic here.&lt;BR /&gt;}&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However this works only if you are projecting one geometry. If you pass more of them then you have to add a collection of attributes and then somehow match the correct geometry with the correct attribute value when the projection result is retrieved (assuming that geometries are returned in the same order).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, I'm a bit confused why instead of taking Geometries it takes Graphics as an argument if it doesn't return back the Graphic.Attributes property. So when you want to re-project a geometry, you have to wrap it inside a Graphic, put it in a collection and then retrieve it back when you get a result. Maybe someone knows why it is done this way and maybe there actually is a way to maintain the Attributes inside a Graphic?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Dec 2010 14:51:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintain-graphic-attributes-when-it-is-reprojected/m-p/368859#M9521</guid>
      <dc:creator>tAndriusBogvila</dc:creator>
      <dc:date>2010-12-30T14:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Maintain graphic attributes when it is reprojected</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintain-graphic-attributes-when-it-is-reprojected/m-p/368860#M9522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;has anyone figured out how to maintain attributes when projecting multiple graphics at once.&amp;nbsp; Not sure I should trust the projected results are returned in the same order as the original list set as the userToken parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd love to call the projectAsync method for each graphic individually but I have a list of potentially hundreds of points.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2012 20:40:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintain-graphic-attributes-when-it-is-reprojected/m-p/368860#M9522</guid>
      <dc:creator>GaryBushek</dc:creator>
      <dc:date>2012-09-25T20:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Maintain graphic attributes when it is reprojected</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintain-graphic-attributes-when-it-is-reprojected/m-p/368861#M9523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you can do it by passing a collection as the usertoken and it's returned in the same order. I wrote a blog post about this a while back &lt;/SPAN&gt;&lt;A href="http://davetimmins.wordpress.com/2011/08/25/using-the-usertoken/"&gt;http://davetimmins.wordpress.com/2011/08/25/using-the-usertoken/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 02:39:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/maintain-graphic-attributes-when-it-is-reprojected/m-p/368861#M9523</guid>
      <dc:creator>DaveTimmins</dc:creator>
      <dc:date>2012-09-26T02:39:36Z</dc:date>
    </item>
  </channel>
</rss>

