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. 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.
Solved! Go to Solution.
I was able to get this to work, I ended up using:
with TemporaryDirectory() as TempDownloadLocation: Download files using TempDownloadLocation
This format so once the code within the "with" statement was done, the temporary folder gets cleaned up automatically.
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')
Since I will be packaging this into a tool for other users to use, I decided to not go this route. I don't think I can get some non programming folk to install geopandas. Thank you though!