<?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: Write JSON from Website to Feature Class in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/write-json-from-website-to-feature-class/m-p/1265093#M67001</link>
    <description>&lt;P&gt;You could go the Json to pandas df, then df to dictionary, then to featureclass to keep it stateless, but if you want to use the JSONToFeatureclass method, then you'll have to write it to a file each time.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2023 18:26:40 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2023-03-07T18:26:40Z</dc:date>
    <item>
      <title>Write JSON from Website to Feature Class</title>
      <link>https://community.esri.com/t5/python-questions/write-json-from-website-to-feature-class/m-p/1265081#M66997</link>
      <description>&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I copy this JSON from this location (web link) to a local file I can import to File GDB.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import arcpy
import os
arcpy.env.workspace = r"C:\Users\xx\Desktop\GIS\IMPORT DEQ DATA"
arcpy.conversion.JSONToFeatures("myjsonfeatures.json", os.path.join("Datasets.gdb", "myfeatures"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want to read the URL live as I want to run this script a couple times a day.&amp;nbsp; How do I do that...&lt;/P&gt;&lt;P&gt;I tried the below but does not work&lt;/P&gt;&lt;LI-CODE lang="c"&gt;import arcpy
import os
geoJSON = "https://apps.deq.virginia.gov/arcgis/rest/services/public/EDMA/MapServer/104/query?outFields=*&amp;amp;where=1%3D1&amp;amp;f=geojson"
arcpy.env.workspace = r"C:\Users\xxx\Desktop\GIS\IMPORT DEQ DATA"
arcpy.conversion.JSONToFeatures(geoJSON, os.path.join("DEQ_Datasets.gdb", "myfeatures"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;", line 512, in &amp;lt;lambda&amp;gt;&lt;BR /&gt;return lambda *args: val(*gp_fixargs(args, True))&lt;BR /&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 000814: Invalid file type&lt;BR /&gt;Failed to execute (JSONToFeatures).&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 18:11:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/write-json-from-website-to-feature-class/m-p/1265081#M66997</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-03-07T18:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Write JSON from Website to Feature Class</title>
      <link>https://community.esri.com/t5/python-questions/write-json-from-website-to-feature-class/m-p/1265087#M66998</link>
      <description>&lt;P&gt;Think the only thing you can do is write it to a file each time since the JSONToFeatures needs a txt file input. You can use the json dumps to write it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with open("sample.json", "w") as outfile:
    json.dump(injson, outfile)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 18:18:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/write-json-from-website-to-feature-class/m-p/1265087#M66998</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-03-07T18:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Write JSON from Website to Feature Class</title>
      <link>https://community.esri.com/t5/python-questions/write-json-from-website-to-feature-class/m-p/1265089#M66999</link>
      <description>&lt;P&gt;So I cannot read it live into the Feature Class... I have to write it local everytime?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 18:20:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/write-json-from-website-to-feature-class/m-p/1265089#M66999</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-03-07T18:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Write JSON from Website to Feature Class</title>
      <link>https://community.esri.com/t5/python-questions/write-json-from-website-to-feature-class/m-p/1265090#M67000</link>
      <description>&lt;P&gt;Is there any other way possible to do this with the service URL I provided?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 18:21:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/write-json-from-website-to-feature-class/m-p/1265090#M67000</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2023-03-07T18:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Write JSON from Website to Feature Class</title>
      <link>https://community.esri.com/t5/python-questions/write-json-from-website-to-feature-class/m-p/1265093#M67001</link>
      <description>&lt;P&gt;You could go the Json to pandas df, then df to dictionary, then to featureclass to keep it stateless, but if you want to use the JSONToFeatureclass method, then you'll have to write it to a file each time.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 18:26:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/write-json-from-website-to-feature-class/m-p/1265093#M67001</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-03-07T18:26:40Z</dc:date>
    </item>
  </channel>
</rss>

