GeofabrikReader.get_osm_pbf_layer_names

GeofabrikReader.get_osm_pbf_layer_names(subregion_name, data_dir=None)

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

Parameters
  • subregion_name (str) – name of a geographic region (case-insensitive) that is available on Geofabrik free download server

  • data_dir

Returns

indices and names of each layer of the PBF data file

Return type

dict

Example:

>>> import os
>>> from pydriosm.reader import GeofabrikReader

>>> geofabrik_reader = GeofabrikReader()

>>> # Download the PBF data file of Rutland to "tests\"
>>> path_to_rutland_pbf = geofabrik_reader.Downloader.download_osm_data(
...     subregion_names='Rutland', osm_file_format=".pbf", download_dir="tests",
...     confirmation_required=False, ret_download_path=True)

>>> lyr_idx_names = geofabrik_reader.get_osm_pbf_layer_names(path_to_rutland_pbf)

>>> lyr_idx_names
{0: 'points',
 1: 'lines',
 2: 'multilinestrings',
 3: 'multipolygons',
 4: 'other_relations'}