<?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: Is it possible to add features from a JSON file to an existing feature class? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/is-it-possible-to-add-features-from-a-json-file-to/m-p/1112620#M62846</link>
    <description>&lt;P&gt;Works for me. With a very large string field in my GeoJSON, I get a default width of 8000 in the output FGDB featureclass.&lt;/P&gt;&lt;P&gt;&amp;nbsp;With an Esri JSON file, the field length is explicit, so you can set it to whatever length you need before running &lt;SPAN&gt;JSONToFeatures&lt;/SPAN&gt;.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"fields":[{"name":"some_attribute","type":"esriFieldTypeString","alias":"some_attribute","length":15000}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 30 Oct 2021 06:23:28 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2021-10-30T06:23:28Z</dc:date>
    <item>
      <title>Is it possible to add features from a JSON file to an existing feature class?</title>
      <link>https://community.esri.com/t5/python-questions/is-it-possible-to-add-features-from-a-json-file-to/m-p/1112257#M62834</link>
      <description>&lt;P&gt;I am trying to use JSONToFeatures to add features from a JSON file to an existing empty feature class using arcpy and I get the following error:&lt;/P&gt;&lt;P&gt;ERROR 000206: Cannot create FeatureClass '&amp;lt;featureClass'. The workspace is not connected.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;out_path = r"C:\\TMP"
gdb_name = "test.gdb"
gdb_full_path = os.path.join(out_path,gdb_name)

arcpy.env.workspace = gdb_full_path
try:
    jsonFile = os.path.join(out_path,'Account.json')
    featureClass = os.path.join(gdb_full_path,'Account')
    arcpy.JSONToFeatures_conversion(jsonFile, featureClass)
except RuntimeError as err:
    print(err)&lt;/LI-CODE&gt;&lt;P&gt;If I delete the target Account feature class then run this code, it works and Account is written to a new feature class.&lt;/P&gt;&lt;P&gt;Unfortunately, I am having to add these features to an existing feature class as certain input string fields are longer than the ArcGIS default 1024 chars and so I need to have these field widths pre-configured to avoid other errors.&lt;/P&gt;&lt;P&gt;Python 2.7&lt;BR /&gt;ArcDesktop 10.8&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 21:30:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-it-possible-to-add-features-from-a-json-file-to/m-p/1112257#M62834</guid>
      <dc:creator>ScotWallace</dc:creator>
      <dc:date>2021-10-28T21:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to add features from a JSON file to an existing feature class?</title>
      <link>https://community.esri.com/t5/python-questions/is-it-possible-to-add-features-from-a-json-file-to/m-p/1112290#M62836</link>
      <description>&lt;LI-CODE lang="python"&gt;arcpy.JSONToFeatures_conversion(jsonFile, Temp_or_InMemory_featureClass)

arcpy.Append_management(
    Temp_or_InMemory_featureClass, output_featureClass,
    schema_type="NO_TEST",  
    field_mapping="your field mapping")&lt;/LI-CODE&gt;&lt;P&gt;Tip - try without schema_type and field_mapping. If it works then no need to specify those optional parameters, otherwise run the Append manually and copy the python snippet for it&amp;nbsp;from the results window to get the appropriate field mapping string.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 00:52:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-it-possible-to-add-features-from-a-json-file-to/m-p/1112290#M62836</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-10-29T00:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to add features from a JSON file to an existing feature class?</title>
      <link>https://community.esri.com/t5/python-questions/is-it-possible-to-add-features-from-a-json-file-to/m-p/1112447#M62842</link>
      <description>&lt;P&gt;I'm running into the same problem with that as I'm not able to pre-configure the field widths for the temporary feature class so I still get the error from JSONToFeatures.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 16:10:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-it-possible-to-add-features-from-a-json-file-to/m-p/1112447#M62842</guid>
      <dc:creator>ScotWallace</dc:creator>
      <dc:date>2021-10-29T16:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to add features from a JSON file to an existing feature class?</title>
      <link>https://community.esri.com/t5/python-questions/is-it-possible-to-add-features-from-a-json-file-to/m-p/1112620#M62846</link>
      <description>&lt;P&gt;Works for me. With a very large string field in my GeoJSON, I get a default width of 8000 in the output FGDB featureclass.&lt;/P&gt;&lt;P&gt;&amp;nbsp;With an Esri JSON file, the field length is explicit, so you can set it to whatever length you need before running &lt;SPAN&gt;JSONToFeatures&lt;/SPAN&gt;.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"fields":[{"name":"some_attribute","type":"esriFieldTypeString","alias":"some_attribute","length":15000}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 06:23:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-it-possible-to-add-features-from-a-json-file-to/m-p/1112620#M62846</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-10-30T06:23:28Z</dc:date>
    </item>
  </channel>
</rss>

