<?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>idea arcpy support for JSON strings in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/arcpy-support-for-json-strings/idi-p/936563</link>
    <description>&lt;P&gt;As far as I'm aware the &lt;STRONG&gt;arcpy.JSONToFeatures_conversion&lt;/STRONG&gt; utility only takes a flat file, e.g., your-json-file.json sitting in a directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to suggest that this utility provide support for strings embedded right in one's script instead of having to summon os and mess with paths.&amp;nbsp; So basically instead of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;import os&lt;/P&gt;&lt;P&gt;file = your_file.json&lt;/P&gt;&lt;P&gt;path = r"C:\Temp"&lt;/P&gt;&lt;P&gt;json_file = os.path.join(path, file)&lt;/P&gt;&lt;P&gt;arcpy.JSONToFeatures(json_fileaaaaahhhhh just makes my head hurt writing it)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it should be like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;json = { bunch of json/geojson }&lt;/P&gt;&lt;P&gt;arcpy.JSONToFeatures(json, output)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, the second approach throws a series of GP errors as it does not appear the tool is set up to handle strings but only files.&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jan 2023 19:32:24 GMT</pubDate>
    <dc:creator>EricEagle</dc:creator>
    <dc:date>2023-01-20T19:32:24Z</dc:date>
    <item>
      <title>arcpy support for JSON strings</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcpy-support-for-json-strings/idi-p/936563</link>
      <description>&lt;P&gt;As far as I'm aware the &lt;STRONG&gt;arcpy.JSONToFeatures_conversion&lt;/STRONG&gt; utility only takes a flat file, e.g., your-json-file.json sitting in a directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to suggest that this utility provide support for strings embedded right in one's script instead of having to summon os and mess with paths.&amp;nbsp; So basically instead of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;import os&lt;/P&gt;&lt;P&gt;file = your_file.json&lt;/P&gt;&lt;P&gt;path = r"C:\Temp"&lt;/P&gt;&lt;P&gt;json_file = os.path.join(path, file)&lt;/P&gt;&lt;P&gt;arcpy.JSONToFeatures(json_fileaaaaahhhhh just makes my head hurt writing it)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it should be like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;json = { bunch of json/geojson }&lt;/P&gt;&lt;P&gt;arcpy.JSONToFeatures(json, output)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, the second approach throws a series of GP errors as it does not appear the tool is set up to handle strings but only files.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 19:32:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcpy-support-for-json-strings/idi-p/936563</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2023-01-20T19:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy support for JSON strings</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcpy-support-for-json-strings/idc-p/936564#M4375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just want to add that because of this limitation, I am doing the following extremely dubious workflow -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doing an automatic "project this raster to the correct UTM zone" script that is meant to be a part of a larger model run by many users with varying levels of connectivity to data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, in the script I put the entire UTM grid in geojson, perfect use case for a geojson string, nobody has to worry about external files, I should be able to simply spatially join the extracted raster geometry (center point) to the grid, keep only common, and read the attributes for the containing zone.&amp;nbsp; Right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I have to take that text, dump it to a file on the user's temp directory, then re-read the file in, and convert it to a feature. (facepalm)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2018 16:42:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcpy-support-for-json-strings/idc-p/936564#M4375</guid>
      <dc:creator>EricEagle</dc:creator>
      <dc:date>2018-10-18T16:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy support for JSON strings</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcpy-support-for-json-strings/idc-p/1232683#M22156</link>
      <description>&lt;P&gt;I think this would help alleviate a lot of frustrations and very unnecessary IO operations to disk.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 13:46:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcpy-support-for-json-strings/idc-p/1232683#M22156</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-11-17T13:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy support for JSON strings</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/arcpy-support-for-json-strings/idc-p/1479921#M30448</link>
      <description>&lt;P&gt;For anyone else who comes across this post, using &lt;STRONG&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/featureset.htm" target="_blank" rel="noopener"&gt;arcpy.FeatureSet&lt;/A&gt;&lt;/STRONG&gt; may be a valid option.&amp;nbsp; It accepts &lt;STRONG&gt;ESRI (featureSet) JSON&lt;/STRONG&gt; and &lt;STRONG&gt;GeoJSON&lt;/STRONG&gt; as inputs.&amp;nbsp; The result can then be copied to disk as a feature class using &lt;STRONG&gt;arcpy.CopyFeatures_management&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 01:55:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/arcpy-support-for-json-strings/idc-p/1479921#M30448</guid>
      <dc:creator>Dan_Joyce_OE</dc:creator>
      <dc:date>2024-05-29T01:55:00Z</dc:date>
    </item>
  </channel>
</rss>

