_Reader.read_shp_zip
- _Reader.read_shp_zip(subregion_name, layer_names=None, feature_names=None, data_dir=None, update=False, download=True, pickle_it=False, ret_pickle_path=False, rm_extracts=False, rm_shp_zip=False, verbose=False, **kwargs)
Read a .shp.zip data file of a geographic (sub)region.
- Parameters
subregion_name (str) – name of a geographic (sub)region (case-insensitive) that is available on Geofabrik free download server
layer_names (str or list or None) – name of a .shp layer, e.g. ‘railways’, or names of multiple layers; if
None
(default), all available layersfeature_names (str or list or None) – name of a feature, e.g. ‘rail’, or names of multiple features; if
None
(default), all available featuresdata_dir (str or None) – directory where the .shp.zip data file is located/saved; if
None
, the default directoryupdate (bool) – whether to check to update pickle backup (if available), defaults to
False
download (bool) – whether to ask for confirmation before starting to download a file, defaults to
True
pickle_it (bool) – whether to save the .shp data as a pickle file, defaults to
False
ret_pickle_path (bool) – (when
pickle_it=True
) whether to return a path to the saved pickle filerm_extracts (bool) – whether to delete extracted files from the .shp.zip file, defaults to
False
rm_shp_zip (bool) – whether to delete the downloaded .shp.zip file, defaults to
False
verbose (bool or int) – whether to print relevant information in console as the function runs, defaults to
False
kwargs – [optional] parameters of the method
SHPReadParse.read_shp()
- Returns
dictionary of the shapefile data, with keys and values being layer names and tabular data (in the format of geopandas.GeoDataFrame), respectively
- Return type
dict or collections.OrderedDict or None
See examples for the methods
GeofabrikReader.read_shp_zip()
andBBBikeReader.read_shp_zip()
.