Index
OpenStreetMap extracts.
This module contains iterators for publically available OpenStreetMap *.osm.pbf
files
repositories.
¶
Bases: str
, Enum
Enum of available OSM extract sources.
¶
Download OSM extracts as PBF files.
PARAMETER | DESCRIPTION |
---|---|
extracts |
List of extracts to download.
TYPE:
|
download_directory |
Directory where PBF files should be saved.
TYPE:
|
progressbar |
Show progress bar. Defaults to True.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[Path]
|
list[Path]: List of downloaded file paths. |
Source code in quackosm/osm_extracts/__init__.py
¶
Find an OSM extract by name.
PARAMETER | DESCRIPTION |
---|---|
query |
Query to search for a particular extract.
TYPE:
|
source |
OSM source name. Can be one of: 'any', 'Geofabrik', 'BBBike', 'OSM_fr'. Defaults to 'any'.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
OpenStreetMapExtract
|
Found extract.
TYPE:
|
Source code in quackosm/osm_extracts/__init__.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
¶
Download an OSM extract by name.
PARAMETER | DESCRIPTION |
---|---|
query |
Query to search for a particular extract.
TYPE:
|
source |
OSM source name. Can be one of: 'any', 'Geofabrik', 'BBBike', 'OSM_fr'. Defaults to 'any'.
TYPE:
|
download_directory |
Directory where the file should be downloaded. Defaults to "files".
TYPE:
|
progressbar |
Show progress bar. Defaults to True.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Path
|
Path to the downloaded OSM extract.
TYPE:
|
Source code in quackosm/osm_extracts/__init__.py
¶
Display all available OSM extracts in the form of a tree.
Output will be printed to the console.
PARAMETER | DESCRIPTION |
---|---|
source |
Source for which extracts should be displayed.
TYPE:
|
use_full_names |
Whether to display full name, or short name of the extract.
Full name contains all parents of the extract. Defaults to
TYPE:
|
use_pager |
Whether to display long output using Rich pager
or just print to output. Defaults to
TYPE:
|
RAISES | DESCRIPTION |
---|---|
ValueError
|
If provided source value cannot be parsed to OsmExtractSource. |
Source code in quackosm/osm_extracts/__init__.py
find_smallest_containing_extracts_total(
geometry,
geometry_coverage_iou_threshold=0.01,
allow_uncovered_geometry=False,
)
¶
find_smallest_containing_extracts_total(
geometry,
geometry_coverage_iou_threshold=0.01,
allow_uncovered_geometry=False,
)
Find smallest extracts from all OSM extract indexes that contains given polygon.
Iterates all indexes and finds smallest extracts that covers a given geometry.
Extracts are selected based on the highest value of the Intersection over Union metric with geometry. Some extracts might be discarded because of low IoU metric value leaving some parts of the geometry uncovered.
PARAMETER | DESCRIPTION |
---|---|
geometry |
Geometry to be covered.
TYPE:
|
geometry_coverage_iou_threshold |
Minimal value of the Intersection over Union metric for selecting the matching OSM extracts. Is best matching extract has value lower than the threshold, it is discarded (except the first one). Has to be in range between 0 and 1. Value of 0 will allow every intersected extract, value of 1 will only allow extracts that match the geometry exactly. Defaults to 0.01.
TYPE:
|
allow_uncovered_geometry |
Suppress an error if some geometry parts aren't covered
by any OSM extract. Defaults to
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[OpenStreetMapExtract]
|
List[OpenStreetMapExtract]: List of extracts name, URL to download it and boundary polygon. |
Source code in quackosm/osm_extracts/__init__.py
find_smallest_containing_geofabrik_extracts(
geometry,
geometry_coverage_iou_threshold=0.01,
allow_uncovered_geometry=False,
)
¶
find_smallest_containing_geofabrik_extracts(
geometry,
geometry_coverage_iou_threshold=0.01,
allow_uncovered_geometry=False,
)
Find smallest extracts from Geofabrik that contains given geometry.
Iterates a geofabrik index and finds smallest extracts that covers a given geometry.
Extracts are selected based on the highest value of the Intersection over Union metric with geometry. Some extracts might be discarded because of low IoU metric value leaving some parts of the geometry uncovered.
PARAMETER | DESCRIPTION |
---|---|
geometry |
Geometry to be covered.
TYPE:
|
geometry_coverage_iou_threshold |
Minimal value of the Intersection over Union metric for selecting the matching OSM extracts. Is best matching extract has value lower than the threshold, it is discarded (except the first one). Has to be in range between 0 and 1. Value of 0 will allow every intersected extract, value of 1 will only allow extracts that match the geometry exactly. Defaults to 0.01.
TYPE:
|
allow_uncovered_geometry |
Suppress an error if some geometry parts aren't covered
by any OSM extract. Defaults to
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[OpenStreetMapExtract]
|
List[OpenStreetMapExtract]: List of extracts name, URL to download it and boundary polygon. |
Source code in quackosm/osm_extracts/__init__.py
find_smallest_containing_openstreetmap_fr_extracts(
geometry,
geometry_coverage_iou_threshold=0.01,
allow_uncovered_geometry=False,
)
¶
find_smallest_containing_openstreetmap_fr_extracts(
geometry,
geometry_coverage_iou_threshold=0.01,
allow_uncovered_geometry=False,
)
Find smallest extracts from OpenStreetMap.fr that contains given polygon.
Iterates an osm.fr index and finds smallest extracts that covers a given geometry.
Extracts are selected based on the highest value of the Intersection over Union metric with geometry. Some extracts might be discarded because of low IoU metric value leaving some parts of the geometry uncovered.
PARAMETER | DESCRIPTION |
---|---|
geometry |
Geometry to be covered.
TYPE:
|
geometry_coverage_iou_threshold |
Minimal value of the Intersection over Union metric for selecting the matching OSM extracts. Is best matching extract has value lower than the threshold, it is discarded (except the first one). Has to be in range between 0 and 1. Value of 0 will allow every intersected extract, value of 1 will only allow extracts that match the geometry exactly. Defaults to 0.01.
TYPE:
|
allow_uncovered_geometry |
Suppress an error if some geometry parts aren't covered
by any OSM extract. Defaults to
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[OpenStreetMapExtract]
|
List[OpenStreetMapExtract]: List of extracts name, URL to download it and boundary polygon. |
Source code in quackosm/osm_extracts/__init__.py
find_smallest_containing_bbbike_extracts(
geometry,
geometry_coverage_iou_threshold=0.01,
allow_uncovered_geometry=False,
)
¶
find_smallest_containing_bbbike_extracts(
geometry,
geometry_coverage_iou_threshold=0.01,
allow_uncovered_geometry=False,
)
Find smallest extracts from BBBike that contains given polygon.
Iterates an BBBike index and finds smallest extracts that covers a given geometry.
Extracts are selected based on the highest value of the Intersection over Union metric with geometry. Some extracts might be discarded because of low IoU metric value leaving some parts of the geometry uncovered.
PARAMETER | DESCRIPTION |
---|---|
geometry |
Geometry to be covered.
TYPE:
|
geometry_coverage_iou_threshold |
Minimal value of the Intersection over Union metric for selecting the matching OSM extracts. Is best matching extract has value lower than the threshold, it is discarded (except the first one). Has to be in range between 0 and 1. Value of 0 will allow every intersected extract, value of 1 will only allow extracts that match the geometry exactly. Defaults to 0.01.
TYPE:
|
allow_uncovered_geometry |
Suppress an error if some geometry parts aren't covered
by any OSM extract. Defaults to
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[OpenStreetMapExtract]
|
List[OpenStreetMapExtract]: List of extracts name, URL to download it and boundary polygon. |
Source code in quackosm/osm_extracts/__init__.py
find_smallest_containing_extracts(
geometry,
source,
geometry_coverage_iou_threshold=0.01,
allow_uncovered_geometry=False,
)
¶
find_smallest_containing_extracts(
geometry,
source,
geometry_coverage_iou_threshold=0.01,
allow_uncovered_geometry=False,
)
Find smallest extracts from a given OSM source that contains given polygon.
Iterates an OSM source index and finds smallest extracts that covers a given geometry.
Extracts are selected based on the highest value of the Intersection over Union metric with geometry. Some extracts might be discarded because of low IoU metric value leaving some parts of the geometry uncovered.
PARAMETER | DESCRIPTION |
---|---|
geometry |
Geometry to be covered.
TYPE:
|
source |
OSM source name. Can be one of: 'any', 'Geofabrik', 'BBBike', 'OSMfr'.
TYPE:
|
geometry_coverage_iou_threshold |
Minimal value of the Intersection over Union metric for selecting the matching OSM extracts. Is best matching extract has value lower than the threshold, it is discarded (except the first one). Has to be in range between 0 and 1. Value of 0 will allow every intersected extract, value of 1 will only allow extracts that match the geometry exactly. Defaults to 0.01.
TYPE:
|
allow_uncovered_geometry |
Suppress an error if some geometry parts aren't covered
by any OSM extract. Defaults to
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[OpenStreetMapExtract]
|
List[OpenStreetMapExtract]: List of extracts name, URL to download it and boundary polygon. |