<?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: Read geometry from JSON object in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/read-geometry-from-json-object/m-p/637648#M17165</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you should ask this question in the ArcObjects forum.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But here my solution in Java:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import com.esri.arcgis.geometry.Polygon; import com.esri.arcgis.system.JSONReader; import com.esri.arcgis.geodatabase.JSONDeserializerGdb;&amp;nbsp;&amp;nbsp; JSONReader reader = new JSONReader(); reader.readFromString(jsonTxt); JSONDeserializerGdb ds = new JSONDeserializerGdb(); ds.initDeserializer(reader, null); Polygon polygon = (Polygon) ds.readGeometry(esriGeometryType.esriGeometryPolygon);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should be similar in C++.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 25 Nov 2012 16:24:23 GMT</pubDate>
    <dc:creator>TomSchuller</dc:creator>
    <dc:date>2012-11-25T16:24:23Z</dc:date>
    <item>
      <title>Read geometry from JSON object</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/read-geometry-from-json-object/m-p/637647#M17164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In Flex 3, I convert a featureset (including several simple polygons) to JSON object: var geomJSON:Object = myFeatureSet.toJSON();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I pass the geomJSON as a parameter to a web service (developed using VS2010 C# language). Now the problem is: how to read the polygons inside the C# web service? What kinds of ESRI classes should I use? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Nov 2012 14:51:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/read-geometry-from-json-object/m-p/637647#M17164</guid>
      <dc:creator>XintaoLiu</dc:creator>
      <dc:date>2012-11-24T14:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: Read geometry from JSON object</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/read-geometry-from-json-object/m-p/637648#M17165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you should ask this question in the ArcObjects forum.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But here my solution in Java:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import com.esri.arcgis.geometry.Polygon; import com.esri.arcgis.system.JSONReader; import com.esri.arcgis.geodatabase.JSONDeserializerGdb;&amp;nbsp;&amp;nbsp; JSONReader reader = new JSONReader(); reader.readFromString(jsonTxt); JSONDeserializerGdb ds = new JSONDeserializerGdb(); ds.initDeserializer(reader, null); Polygon polygon = (Polygon) ds.readGeometry(esriGeometryType.esriGeometryPolygon);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should be similar in C++.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 Nov 2012 16:24:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/read-geometry-from-json-object/m-p/637648#M17165</guid>
      <dc:creator>TomSchuller</dc:creator>
      <dc:date>2012-11-25T16:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Read geometry from JSON object</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/read-geometry-from-json-object/m-p/637649#M17166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hy,&lt;BR /&gt;you should ask this question in the ArcObjects forum.&lt;BR /&gt;&lt;BR /&gt;But here my solution in Java:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import com.esri.arcgis.geometry.Polygon;
import com.esri.arcgis.system.JSONReader;
import com.esri.arcgis.geodatabase.JSONDeserializerGdb;


JSONReader reader = new JSONReader();
reader.readFromString(jsonTxt);
JSONDeserializerGdb ds = new JSONDeserializerGdb();
ds.initDeserializer(reader, null);
Polygon polygon = (Polygon) ds.readGeometry(esriGeometryType.esriGeometryPolygon);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;This should be similar in C++.&lt;BR /&gt;&lt;BR /&gt;Tom&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot! It is very helpful! I will try in my C# project and then get back. Thank you again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:06:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/read-geometry-from-json-object/m-p/637649#M17166</guid>
      <dc:creator>XintaoLiu</dc:creator>
      <dc:date>2021-12-12T03:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Read geometry from JSON object</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/read-geometry-from-json-object/m-p/637650#M17167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was trying this in C#. However when I cast that to IPolygon (which should be the .NET-equivalent to the Polygon-interface in your Java-solution), I get an InvalidCastException, as seen here&amp;nbsp;&lt;A href="https://community.esri.com/thread/215252-jsonconvertergeometryclass-creates-invalid-geometries"&gt;https://community.esri.com/thread/215252-jsonconvertergeometryclass-creates-invalid-geometries&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2018 08:43:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/read-geometry-from-json-object/m-p/637650#M17167</guid>
      <dc:creator>CarstenSchumann</dc:creator>
      <dc:date>2018-05-23T08:43:00Z</dc:date>
    </item>
  </channel>
</rss>

