class pydriosm.reader.GeofabrikReader(data_dir=None, max_tmpfile_size=None)[source]

Read Geofabrik OpenStreetMap data extracts.

  • max_tmpfile_size (int | None) – defaults to None, see also the function pyhelpers.settings.gdal_configurations()

  • data_dir (str | None) – (a path or a name of) a directory where a data file is, defaults to None; when data_dir=None, it refers to a folder named osm_geofabrik under the current working directory

  • downloader (GeofabrikDownloader) – instance of the class GeofabrikDownloader

  • name (str) – name of the data resource

  • url (str) – url of the homepage to the Geofabrik free download server


>>> from pydriosm.reader import GeofabrikReader

>>> gfr = GeofabrikReader()

>>> gfr.NAME



str: Default download directory.


set: Valid file formats.


get_file_path(subregion_name, osm_file_format)

Get the local path to an OSM data file of a geographic (sub)region.

get_pbf_layer_names(subregion_name[, data_dir])

Get indices and names of all layers in the PBF data file of a given (sub)region.

get_shp_pathname(subregion_name[, ...])

Get path(s) to .shp file(s) for a geographic (sub)region (by searching a local data directory).

merge_subregion_layer_shp(subregion_names, ...)

Merge shapefiles for a specific layer of two or multiple geographic regions.

read_osm_pbf(subregion_name[, data_dir, ...])

Read a PBF (.osm.pbf) data file of a geographic (sub)region.

read_shp_zip(subregion_name[, layer_names, ...])

Read a data file of a geographic (sub)region.