From 030febcab290fdc065a91941069a6f4cc3117d90 Mon Sep 17 00:00:00 2001 From: Ardie Orden Date: Fri, 22 Nov 2019 06:16:40 +0800 Subject: [PATCH] DOC: Add docs for using read_file on a ZIP file (#1181) * Add docs for using read_file on a ZIP file * Add docs for opening ZIP files with folders and multiple datasets * Fix wording of docs --- doc/source/io.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/source/io.rst b/doc/source/io.rst index 6764dae..170262a 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -28,6 +28,20 @@ a web URL, for example for GeoJSON files from `geojson.xyz url = "http://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_110m_land.geojson" df = geopandas.read_file(url) +You can also load ZIP files that contain your data:: + + zipfile = "zip:///Users/name/Downloads/cb_2017_us_state_500k.zip" + states = geopandas.read_file(zipfile) + +If the dataset is in a folder in the ZIP file, you have to append its name:: + + zipfile = "zip:///Users/name/Downloads/gadm36_AFG_shp.zip!data" + +If there are multiple datasets in a folder in the ZIP file, you also have to specify the filename:: + + zipfile = "zip:///Users/name/Downloads/gadm36_AFG_shp.zip!data/gadm36_AFG_1.shp" + + *geopandas* can also get data from a PostGIS database using the ``read_postgis()`` command.