mirror of
https://github.com/wassname/geopandas.git
synced 2026-09-23 13:20:36 +08:00
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
This commit is contained in:
committed by
Martin Fleischmann
parent
ff7a8a3db1
commit
030febcab2
@@ -28,6 +28,20 @@ a web URL, for example for GeoJSON files from `geojson.xyz <http://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.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user