<?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: How do I access the data from this json? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284796#M26256</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Is there any reason you are doing a direct AJAX request instead of doing this in the GeometryService class and it's project method (that way you do not have to manually parse the result)?&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://developers.arcgis.com/javascript/3/jsapi/geometryservice-amd.html#project" title="https://developers.arcgis.com/javascript/3/jsapi/geometryservice-amd.html#project"&gt;https://developers.arcgis.com/javascript/3/jsapi/geometryservice-amd.html#project&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Apr 2020 15:58:25 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2020-04-14T15:58:25Z</dc:date>
    <item>
      <title>How do I access the data from this json?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284795#M26255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to access the results of the following URL in my Javascript code. The result returned is a JSON, and I'm trying to get the x and y results of that JSON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the URL:&lt;/P&gt;&lt;P&gt;&lt;A href="https://jcgis.jacksongov.org/arcgis/rest/services/Utilities/Geometry/GeometryServer/project?inSR=102698&amp;amp;outSR=4326&amp;amp;geometries=%7B%0D%0A++%22geometryType%22+%3A+%22esriGeometryPoint%22%2C%0D%0A++%22geometries%22+%3A+%5B%0D%0A+++++%7B%0D%0A+++++++%22x%22+%3A+2806540.74997300%2C+%0D%0A+++++++%22y%22+%3A+1036617.12483400%0D%0A+++++%7D%0D%0A++%5D%0D%0A%7D&amp;amp;transformation=&amp;amp;transformForward=true&amp;amp;vertical=false&amp;amp;f=html" rel="nofollow noopener noreferrer" target="_blank"&gt;https://jcgis.jacksongov.org/arcgis/rest/services/Utilities/Geometry/GeometryServer/project?inSR=102698&amp;amp;outSR=4326&amp;amp;geometries=%7B%0D%0A++%22geometryType%22+%3A+%22esriGeometryPoint%22%2C%0D%0A++%22geometries%22+%3A+%5B%0D%0A+++++%7B%0D%0A+++++++%22x%22+%3A+2806540.74997300%2C+%0D%0A+++++++%22y%22+%3A+1036617.12483400%0D%0A+++++%7D%0D%0A++%5D%0D%0A%7D&amp;amp;transformation=&amp;amp;transformForward=true&amp;amp;vertical=false&amp;amp;f=html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would use GET which returns the following object:&lt;/P&gt;&lt;P&gt;&lt;A href="https://jcgis.jacksongov.org/arcgis/rest/services/Utilities/Geometry/GeometryServer/project?inSR=102698&amp;amp;outSR=4326&amp;amp;geometries=%7B%0D%0A++%22geometryType%22+%3A+%22esriGeometryPoint%22%2C%0D%0A++%22geometries%22+%3A+%5B%0D%0A+++++%7B%0D%0A+++++++%22x%22+%3A+2806540.74997300%2C++++++++%22y%22+%3A+1036617.12483400%0D%0A+++++%7D%0D%0A++%5D%0D%0A%7D&amp;amp;transformation=&amp;amp;transformForward=true&amp;amp;vertical=false&amp;amp;f=pjson" rel="nofollow noopener noreferrer" target="_blank"&gt;https://jcgis.jacksongov.org/arcgis/rest/services/Utilities/Geometry/GeometryServer/project?inSR=102698&amp;amp;outSR=4326&amp;amp;geometries=%7B%0D%0A++%22geometryType%22+%3A+%22esriGeometryPoint%22%2C%0D%0A++%22geometries%22+%3A+%5B%0D%0A+++++%7B%0D%0A+++++++%22x%22+%3A+2806540.74997300%2C++++++++%22y%22+%3A+1036617.12483400%0D%0A+++++%7D%0D%0A++%5D%0D%0A%7D&amp;amp;transformation=&amp;amp;transformForward=true&amp;amp;vertical=false&amp;amp;f=pjson&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will actually have variables for the lat, long coordinates, but let's leave that hard-coded for the moment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried all sorts of methods of trying to grab the x and y results but nothing's worked. Currently I have an ajax call like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; lat&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; long&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; temp&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; url &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"https://jcgis.jacksongov.org/arcgis/rest/services/Utilities/Geometry/GeometryServer/project?inSR=102698&amp;amp;outSR=4326&amp;amp;geometries=%7B%0D%0A++%22geometryType%22+%3A+%22esriGeometryPoint%22%2C%0D%0A++%22geometries%22+%3A+%5B%0D%0A+++++%7B%0D%0A+++++++%22x%22+%3A+2806540.74997300%2C++++++++%22y%22+%3A+1036617.12483400%0D%0A+++++%7D%0D%0A++%5D%0D%0A%7D&amp;amp;transformation=&amp;amp;transformForward=true&amp;amp;vertical=false&amp;amp;f=pjson"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
$&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ajax&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
   dataType&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'json'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
   type&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GET"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
   url&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; url&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
   success&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;jsonobject&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
   &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
      temp &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; JSON&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;parse&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;jsonobject&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      lat &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; temp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometries&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      long &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; temp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometries&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;y&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
   &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am not sure I am using the parse correctly, but looking at examples in various places online I'm not sure how else it should be done. When I try to run the code the only result I get is "undefined."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:46:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284795#M26255</guid>
      <dc:creator>JohnAdams</dc:creator>
      <dc:date>2021-12-11T13:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I access the data from this json?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284796#M26256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Is there any reason you are doing a direct AJAX request instead of doing this in the GeometryService class and it's project method (that way you do not have to manually parse the result)?&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://developers.arcgis.com/javascript/3/jsapi/geometryservice-amd.html#project" title="https://developers.arcgis.com/javascript/3/jsapi/geometryservice-amd.html#project"&gt;https://developers.arcgis.com/javascript/3/jsapi/geometryservice-amd.html#project&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2020 15:58:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284796#M26256</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-04-14T15:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I access the data from this json?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284797#M26257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We're trying to&amp;nbsp;convert state plane coordinates to lat-long. We're also using the 4x API. We've looked at the API but could not find anything that converts state plane to lat-long.The best thing we figured out was to use our own geometry service. If there's some other way of doing it, I'm all ears.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2020 17:15:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284797#M26257</guid>
      <dc:creator>JohnAdams</dc:creator>
      <dc:date>2020-04-14T17:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I access the data from this json?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284798#M26258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3101"&gt;Robert Scheitlin, GISP&lt;/A&gt;&amp;nbsp;Could you provide code in JS API 4 where you convert from State Plane to&amp;nbsp;Lat Long. using a geometry service?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2020 23:51:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284798#M26258</guid>
      <dc:creator>RichardBuford</dc:creator>
      <dc:date>2020-04-14T23:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I access the data from this json?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284799#M26259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Richard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Here is a sample that does clinetside projection.&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=client-projection" title="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=client-projection"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=client-projection&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have a sample for what you are specifically looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Apr 2020 13:39:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284799#M26259</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-04-15T13:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I access the data from this json?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284800#M26260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;gt;&lt;SPAN style="background-color: #ffffff;"&gt;We've looked at the API but could not find anything that converts state plane to lat-long.The best thing we figured out was to use our own geometry service.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sounds like you're trying to project individual geometries, and I'm also assuming from that above you'd rather do this client-side than call GeometryService. If so, then the&amp;nbsp;&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;esri/geometry/projection&amp;nbsp;&lt;/SPAN&gt;module's &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;project()&lt;/SPAN&gt; method should work. Sample code in this doc as well:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-projection.html#project"&gt;projection | ArcGIS API for JavaScript 4.15&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You just need to know the wkid of both the "from" and the "to" coordinate systems, and if those coordinate systems are using different datums, for best accuracy, you're also going to mix in a geographic transformation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2020 00:15:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-do-i-access-the-data-from-this-json/m-p/284800#M26260</guid>
      <dc:creator>JimBarry</dc:creator>
      <dc:date>2020-04-16T00:15:49Z</dc:date>
    </item>
  </channel>
</rss>

