GeofabrikReader

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

Read Geofabrik OpenStreetMap data extracts.

Parameters:
  • 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

Variables:
  • 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

Examples:

>>> from pydriosm.reader import GeofabrikReader

>>> gfr = GeofabrikReader()

>>> gfr.NAME
'Geofabrik'

Attributes

DEFAULT_DATA_DIR

str: Default download directory.

FILE_FORMATS

set: Valid file formats.

Methods

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 .shp.zip data file of a geographic (sub)region.