<?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: Creating Layers from files in memory in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/creating-layers-from-files-in-memory/m-p/1100120#M62514</link>
    <description>&lt;P&gt;If you're using ArcGIS Pro 2.8+ you could install geopandas (in a cloned env). You can &lt;A href="https://geopandas.readthedocs.io/en/latest/docs/user_guide/io.html" target="_self"&gt;read&lt;/A&gt; from a zipfile URL directly into a geodataframe, &lt;A href="https://geopandas.org/docs/user_guide/mergingdata.html#appending" target="_self"&gt;append&lt;/A&gt; more geodataframes, and then &lt;A href="https://geopandas.readthedocs.io/en/latest/docs/user_guide/io.html#writing-spatial-data" target="_self"&gt;write&lt;/A&gt; out to file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import geopandas as gpd

a_url = 'https://github.com/Toblerity/Fiona/raw/master/tests/data/coutwildrnp.zip'
gdf = gpd.read_file(a_url)

another_url = 'https://github.com/Toblerity/Fiona/raw/master/tests/data/coutwildrnp.zip'
gdf.append(gpd.read_file(another_url))

gdf.to_file('test.shp')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2021 02:22:02 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2021-09-21T02:22:02Z</dc:date>
    <item>
      <title>Creating Layers from files in memory</title>
      <link>https://community.esri.com/t5/python-questions/creating-layers-from-files-in-memory/m-p/1099985#M62503</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I was wondering if it was possible to create an "in_memory" or a "memory" feature layer from a downloaded zipped shapefile, without saving that zip file to the disk.&amp;nbsp; I am hoping to download multiple zip files from an ftp site and compile them into one final deliverable with only the final shapefile or feature class being written to disk.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 16:37:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-layers-from-files-in-memory/m-p/1099985#M62503</guid>
      <dc:creator>mattkramer</dc:creator>
      <dc:date>2021-09-20T16:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Layers from files in memory</title>
      <link>https://community.esri.com/t5/python-questions/creating-layers-from-files-in-memory/m-p/1100045#M62506</link>
      <description>&lt;P&gt;Could you use &lt;A href="https://docs.python.org/3/library/tempfile.html#tempfile.mkdtemp" target="_self"&gt;tempfile.mkdtemp()&lt;/A&gt; to make a temporary directory to unzip the shapefile and then clean it up when finished?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 19:10:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-layers-from-files-in-memory/m-p/1100045#M62506</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-09-20T19:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Layers from files in memory</title>
      <link>https://community.esri.com/t5/python-questions/creating-layers-from-files-in-memory/m-p/1100120#M62514</link>
      <description>&lt;P&gt;If you're using ArcGIS Pro 2.8+ you could install geopandas (in a cloned env). You can &lt;A href="https://geopandas.readthedocs.io/en/latest/docs/user_guide/io.html" target="_self"&gt;read&lt;/A&gt; from a zipfile URL directly into a geodataframe, &lt;A href="https://geopandas.org/docs/user_guide/mergingdata.html#appending" target="_self"&gt;append&lt;/A&gt; more geodataframes, and then &lt;A href="https://geopandas.readthedocs.io/en/latest/docs/user_guide/io.html#writing-spatial-data" target="_self"&gt;write&lt;/A&gt; out to file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import geopandas as gpd

a_url = 'https://github.com/Toblerity/Fiona/raw/master/tests/data/coutwildrnp.zip'
gdf = gpd.read_file(a_url)

another_url = 'https://github.com/Toblerity/Fiona/raw/master/tests/data/coutwildrnp.zip'
gdf.append(gpd.read_file(another_url))

gdf.to_file('test.shp')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 02:22:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-layers-from-files-in-memory/m-p/1100120#M62514</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-09-21T02:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Layers from files in memory</title>
      <link>https://community.esri.com/t5/python-questions/creating-layers-from-files-in-memory/m-p/1101950#M62542</link>
      <description>&lt;P&gt;I was able to get this to work, I ended up using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with TemporaryDirectory() as TempDownloadLocation:

            Download files using TempDownloadLocation&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This format so once the code within the "with" statement was done, the temporary folder gets cleaned up automatically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sun, 26 Sep 2021 15:46:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-layers-from-files-in-memory/m-p/1101950#M62542</guid>
      <dc:creator>mattkramer</dc:creator>
      <dc:date>2021-09-26T15:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Layers from files in memory</title>
      <link>https://community.esri.com/t5/python-questions/creating-layers-from-files-in-memory/m-p/1101951#M62543</link>
      <description>&lt;P&gt;Since I will be packaging this into a tool for other users to use, I decided to not go this route.&amp;nbsp; I don't think I can get some non programming folk to install geopandas.&amp;nbsp; Thank you though!&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 15:47:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-layers-from-files-in-memory/m-p/1101951#M62543</guid>
      <dc:creator>mattkramer</dc:creator>
      <dc:date>2021-09-26T15:47:55Z</dc:date>
    </item>
  </channel>
</rss>

