Basic functions¶
overturemaestro.functions ¶
Functions.
This module contains helper functions to simplify the usage.
convert_bounding_box_to_geodataframe ¶
convert_bounding_box_to_geodataframe(
theme: str,
type: str,
bbox: tuple[float, float, float, float],
release: Optional[str] = None,
*,
pyarrow_filter: Optional[PYARROW_FILTER] = None,
columns_to_download: Optional[list[str]] = None,
ignore_cache: bool = False,
working_directory: Union[str, Path] = "files",
verbosity_mode: VERBOSITY_MODE = "transient",
max_workers: Optional[int] = None
) -> gpd.GeoDataFrame
Get a GeoDataFrame with Overture Maps data within given bounding box.
Automatically downloads Overture Maps dataset for a given release and theme/type in a concurrent manner and returns a single GeoDataFrame as a result.
PARAMETER | DESCRIPTION |
---|---|
theme |
Theme of the dataset.
TYPE:
|
type |
Type of the dataset.
TYPE:
|
bbox |
Bounding box used to filter data. Order of values: xmin, ymin, xmax, ymax.
TYPE:
|
release |
Release version. If not provided, will automatically load newest available release version. Defaults to None.
TYPE:
|
pyarrow_filter |
Filters to apply on a pyarrow dataset. Can be pyarrow.compute.Expression or List[Tuple] or List[List[Tuple]]. Defaults to None.
TYPE:
|
columns_to_download |
List of columns to download. Automatically adds geometry column to the list. If None, will download all columns. Defaults to None.
TYPE:
|
ignore_cache |
Whether to ignore precalculated geoparquet files or not. Defaults to False.
TYPE:
|
working_directory |
Directory where to save
the downloaded
TYPE:
|
verbosity_mode |
Set progress verbosity mode. Can be one of: silent, transient and verbose. Silent disables output completely. Transient tracks progress, but removes output after finished. Verbose leaves all progress outputs in the stdout. Defaults to "transient".
TYPE:
|
max_workers |
Max number of multiprocessing workers used to process the dataset. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
GeoDataFrame
|
gpd.GeoDataFrame: GeoDataFrame with Overture Maps features. |
Examples:
Get buildings in the center of London.
>>> import overturemaestro as om
>>> london_bbox = (-0.120077, 51.498164, -0.090809, 51.508849)
>>> gdf = om.convert_bounding_box_to_geodataframe(
... release="2024-08-20.0",
... theme="buildings",
... type="building",
... bbox=london_bbox,
... )
>>> gdf[['names', 'subtype']].sort_index()
names subtype
id
08b194ad14804fff0200fea269f9879c {'primary': 'Park Plaza London ... None
08b194ad14812fff02006b5f7b4749e1 None None
08b194ad14814fff02002e44dac80f43 {'primary': 'The Barn', 'common... agricultural
08b194ad14814fff0200c77856a66cd7 None None
08b194ad14814fff0200dbc14b9a6d57 None None
... ... ...
08b194ad33db2fff02006a3ce00700f9 {'primary': 'citizenM hotel Lon... None
08b194ad33db3fff02008b05d22745ed {'primary': 'Metal Box Factory'... None
08b194ad33db4fff0200cb2043a25c3c None commercial
08b194ad33db4fff0200f2ead15d53ac None residential
08b194ad33db5fff02005eaafd2ff033 {'primary': 'Cooper & Southwark... commercial
[1863 rows x 2 columns]
Download museums in the same area from places dataset with a filter.
>>> gdf = om.convert_bounding_box_to_geodataframe(
... release="2024-08-20.0",
... theme="places",
... type="place",
... bbox=london_bbox,
... pyarrow_filter=[[
... (("categories", "primary"), "=", "museum"),
... ("confidence", ">", 0.95),
... ]],
... )
>>> gdf[["names", "confidence"]].sort_values(by='confidence', ascending=False)
names confidence
id
08f194ad32a0d494030fdddc1b405fb1 {'primary': 'Shakespeare's Glob... 0.991993
08f194ad1499c8b1038ff3e213d81456 {'primary': 'Florence Nightinga... 0.982253
08f194ad30690a42034312e00c0254a2 {'primary': 'The Clink Prison M... 0.982253
08f194ad149044c6037575af3681766f {'primary': 'Philip Simpson Des... 0.969941
08f194ad30695784036410e184708927 {'primary': 'Clink Street Londo... 0.965185
Source code in overturemaestro/functions.py
875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 |
|
convert_bounding_box_to_geodataframe_for_multiple_types ¶
convert_bounding_box_to_geodataframe_for_multiple_types(
theme_type_pairs: list[tuple[str, str]],
bbox: tuple[float, float, float, float],
release: Optional[str] = None,
*,
pyarrow_filters: Optional[list[Optional[PYARROW_FILTER]]] = None,
columns_to_download: Optional[list[Optional[list[str]]]] = None,
ignore_cache: bool = False,
working_directory: Union[str, Path] = "files",
verbosity_mode: VERBOSITY_MODE = "transient",
max_workers: Optional[int] = None
) -> list[gpd.GeoDataFrame]
Get GeoDataFrames list with Overture Maps data within given bounding box for multiple types.
Automatically downloads Overture Maps dataset for a given release and theme/type pairs in a concurrent manner and returns a list of GeoDataFrames as a result.
Order of GeoDataFrames is the same as the input theme_type_pairs list.
PARAMETER | DESCRIPTION |
---|---|
theme_type_pairs |
Pairs of themes and types of the dataset.
TYPE:
|
bbox |
Bounding box used to filter data. Order of values: xmin, ymin, xmax, ymax.
TYPE:
|
release |
Release version. If not provided, will automatically load newest available release version. Defaults to None.
TYPE:
|
pyarrow_filters |
A list of pyarrow expressions used to filter specific theme type pair. Must be the same length as the list of theme type pairs. Defaults to None.
TYPE:
|
columns_to_download |
A list of pyarrow expressions used to filter specific theme type pair. Must be the same length as the list of theme type pairs. Defaults to None.
TYPE:
|
ignore_cache |
Whether to ignore precalculated geoparquet files or not. Defaults to False.
TYPE:
|
working_directory |
Directory where to save
the downloaded
TYPE:
|
verbosity_mode |
Set progress verbosity mode. Can be one of: silent, transient and verbose. Silent disables output completely. Transient tracks progress, but removes output after finished. Verbose leaves all progress outputs in the stdout. Defaults to "transient".
TYPE:
|
max_workers |
Max number of multiprocessing workers used to process the dataset. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[GeoDataFrame]
|
list[gpd.GeoDataFrame]: List of GeoDataFrames with Overture Maps features. |
Source code in overturemaestro/functions.py
convert_bounding_box_to_parquet ¶
convert_bounding_box_to_parquet(
theme: str,
type: str,
bbox: tuple[float, float, float, float],
release: Optional[str] = None,
*,
pyarrow_filter: Optional[PYARROW_FILTER] = None,
columns_to_download: Optional[list[str]] = None,
result_file_path: Optional[Union[str, Path]] = None,
ignore_cache: bool = False,
working_directory: Union[str, Path] = "files",
verbosity_mode: VERBOSITY_MODE = "transient",
max_workers: Optional[int] = None
) -> Path
Get a GeoParquet file with Overture Maps data within given bounding box.
Automatically downloads Overture Maps dataset for a given release and theme/type in a concurrent manner and returns a single file as a result.
PARAMETER | DESCRIPTION |
---|---|
theme |
Theme of the dataset.
TYPE:
|
type |
Type of the dataset.
TYPE:
|
bbox |
Bounding box used to filter data. Order of values: xmin, ymin, xmax, ymax.
TYPE:
|
release |
Release version. If not provided, will automatically load newest available release version. Defaults to None.
TYPE:
|
pyarrow_filter |
Filters to apply on a pyarrow dataset. Can be pyarrow.compute.Expression or List[Tuple] or List[List[Tuple]]. Defaults to None.
TYPE:
|
columns_to_download |
List of columns to download. Automatically adds geometry column to the list. If None, will download all columns. Defaults to None.
TYPE:
|
result_file_path |
Where to save the geoparquet file. If not provided, will be generated based on hashes from filters. Defaults to None.
TYPE:
|
ignore_cache |
Whether to ignore precalculated geoparquet files or not. Defaults to False.
TYPE:
|
working_directory |
Directory where to save
the downloaded
TYPE:
|
verbosity_mode |
Set progress verbosity mode. Can be one of: silent, transient and verbose. Silent disables output completely. Transient tracks progress, but removes output after finished. Verbose leaves all progress outputs in the stdout. Defaults to "transient".
TYPE:
|
max_workers |
Max number of multiprocessing workers used to process the dataset. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Path
|
Path to the generated GeoParquet file.
TYPE:
|
Examples:
Get buildings in the center of London.
>>> import overturemaestro as om
>>> london_bbox = (-0.120077, 51.498164, -0.090809, 51.508849)
>>> gpq_path = om.convert_bounding_box_to_parquet(
... release="2024-08-20.0",
... theme="buildings",
... type="building",
... bbox=london_bbox,
... )
>>> gpq_path.as_posix()
'files/2024-08-20.0/theme=buildings/type=building/7ed11f0d_nofilter.parquet'
Inspect the content
>>> import geopandas as gpd
>>> gdf = gpd.read_parquet(gpq_path)
>>> len(gdf)
1863
>>> list(gdf.columns)
['id', 'geometry', 'bbox', 'version', 'sources', 'subtype', 'class', 'names', 'level',
'has_parts', 'height', 'is_underground', 'num_floors', 'num_floors_underground',
'min_height', 'min_floor', 'facade_color', 'facade_material', 'roof_material', 'roof_shape',
'roof_direction', 'roof_orientation', 'roof_color', 'roof_height', 'theme', 'type']
Download museums in the same area from places dataset with a filter.
>>> gpq_path = om.convert_bounding_box_to_parquet(
... release="2024-08-20.0",
... theme="places",
... type="place",
... bbox=london_bbox,
... pyarrow_filter=[[
... (("categories", "primary"), "=", "museum"),
... ("confidence", ">", 0.95),
... ]],
... )
>>> gdf = gpd.read_parquet(gpq_path)
>>> len(gdf)
5
>>> gdf[["id", "names", "confidence"]]
id names confidence
0 08f194ad1499c8b1038ff3e213d81456 {'primary': 'Florence Nightinga... 0.982253
1 08f194ad149044c6037575af3681766f {'primary': 'Philip Simpson Des... 0.969941
2 08f194ad32a0d494030fdddc1b405fb1 {'primary': 'Shakespeare's Glob... 0.991993
3 08f194ad30695784036410e184708927 {'primary': 'Clink Street Londo... 0.965185
4 08f194ad30690a42034312e00c0254a2 {'primary': 'The Clink Prison M... 0.982253
Source code in overturemaestro/functions.py
613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 |
|
convert_bounding_box_to_parquet_for_multiple_types ¶
convert_bounding_box_to_parquet_for_multiple_types(
theme_type_pairs: list[tuple[str, str]],
bbox: tuple[float, float, float, float],
release: Optional[str] = None,
*,
pyarrow_filters: Optional[list[Optional[PYARROW_FILTER]]] = None,
columns_to_download: Optional[list[Optional[list[str]]]] = None,
ignore_cache: bool = False,
working_directory: Union[str, Path] = "files",
verbosity_mode: VERBOSITY_MODE = "transient",
max_workers: Optional[int] = None
) -> list[Path]
Get GeoParquet files with Overture Maps data within given bounding box for multiple types.
Automatically downloads Overture Maps dataset for a given release and theme/type pairs in a concurrent manner and returns a list of files as a result.
Order of paths is the same as the input theme_type_pairs list.
PARAMETER | DESCRIPTION |
---|---|
theme_type_pairs |
Pairs of themes and types of the dataset.
TYPE:
|
bbox |
Bounding box used to filter data. Order of values: xmin, ymin, xmax, ymax.
TYPE:
|
release |
Release version. If not provided, will automatically load newest available release version. Defaults to None.
TYPE:
|
pyarrow_filters |
A list of pyarrow expressions used to filter specific theme type pair. Must be the same length as the list of theme type pairs. Defaults to None.
TYPE:
|
columns_to_download |
A list of pyarrow expressions used to filter specific theme type pair. Must be the same length as the list of theme type pairs. Defaults to None.
TYPE:
|
ignore_cache |
Whether to ignore precalculated geoparquet files or not. Defaults to False.
TYPE:
|
working_directory |
Directory where to save
the downloaded
TYPE:
|
verbosity_mode |
Set progress verbosity mode. Can be one of: silent, transient and verbose. Silent disables output completely. Transient tracks progress, but removes output after finished. Verbose leaves all progress outputs in the stdout. Defaults to "transient".
TYPE:
|
max_workers |
Max number of multiprocessing workers used to process the dataset. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[Path]
|
list[Path]: List of paths to the generated GeoParquet files. |
Source code in overturemaestro/functions.py
convert_geometry_to_geodataframe ¶
convert_geometry_to_geodataframe(
theme: str,
type: str,
geometry_filter: BaseGeometry,
release: Optional[str] = None,
*,
pyarrow_filter: Optional[PYARROW_FILTER] = None,
columns_to_download: Optional[list[str]] = None,
ignore_cache: bool = False,
working_directory: Union[str, Path] = "files",
verbosity_mode: VERBOSITY_MODE = "transient",
max_workers: Optional[int] = None
) -> gpd.GeoDataFrame
Get a GeoDataFrame with Overture Maps data within given geometry.
Automatically downloads Overture Maps dataset for a given release and theme/type in a concurrent manner and returns a single GeoDataFrame as a result.
PARAMETER | DESCRIPTION |
---|---|
theme |
Theme of the dataset.
TYPE:
|
type |
Type of the dataset.
TYPE:
|
geometry_filter |
Geometry used to filter data.
TYPE:
|
release |
Release version. If not provided, will automatically load newest available release version. Defaults to None.
TYPE:
|
pyarrow_filter |
Filters to apply on a pyarrow dataset. Can be pyarrow.compute.Expression or List[Tuple] or List[List[Tuple]]. Defaults to None.
TYPE:
|
columns_to_download |
List of columns to download. Automatically adds geometry column to the list. If None, will download all columns. Defaults to None.
TYPE:
|
ignore_cache |
Whether to ignore precalculated geoparquet files or not. Defaults to False.
TYPE:
|
working_directory |
Directory where to save
the downloaded
TYPE:
|
verbosity_mode |
Set progress verbosity mode. Can be one of: silent, transient and verbose. Silent disables output completely. Transient tracks progress, but removes output after finished. Verbose leaves all progress outputs in the stdout. Defaults to "transient".
TYPE:
|
max_workers |
Max number of multiprocessing workers used to process the dataset. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
GeoDataFrame
|
gpd.GeoDataFrame: GeoDataFrame with Overture Maps features. |
Examples:
Get buildings in the center of London.
>>> import overturemaestro as om
>>> from shapely import box
>>> london_bbox = box(-0.120077, 51.498164, -0.090809, 51.508849)
>>> gdf = om.convert_geometry_to_geodataframe(
... release="2024-08-20.0",
... theme="buildings",
... type="building",
... geometry_filter=london_bbox,
... )
>>> gdf[['names', 'subtype']].sort_index()
names subtype
id
08b194ad14804fff0200fea269f9879c {'primary': 'Park Plaza London ... None
08b194ad14812fff02006b5f7b4749e1 None None
08b194ad14814fff02002e44dac80f43 {'primary': 'The Barn', 'common... agricultural
08b194ad14814fff0200c77856a66cd7 None None
08b194ad14814fff0200dbc14b9a6d57 None None
... ... ...
08b194ad33db2fff02006a3ce00700f9 {'primary': 'citizenM hotel Lon... None
08b194ad33db3fff02008b05d22745ed {'primary': 'Metal Box Factory'... None
08b194ad33db4fff0200cb2043a25c3c None commercial
08b194ad33db4fff0200f2ead15d53ac None residential
08b194ad33db5fff02005eaafd2ff033 {'primary': 'Cooper & Southwark... commercial
[1863 rows x 2 columns]
Download museums in the same area from places dataset with a filter.
>>> gdf = om.convert_geometry_to_geodataframe(
... release="2024-08-20.0",
... theme="places",
... type="place",
... geometry_filter=london_bbox,
... pyarrow_filter=[[
... (("categories", "primary"), "=", "museum"),
... ("confidence", ">", 0.95),
... ]],
... )
>>> gdf[["names", "confidence"]].sort_values(by='confidence', ascending=False)
names confidence
id
08f194ad32a0d494030fdddc1b405fb1 {'primary': 'Shakespeare's Glob... 0.991993
08f194ad1499c8b1038ff3e213d81456 {'primary': 'Florence Nightinga... 0.982253
08f194ad30690a42034312e00c0254a2 {'primary': 'The Clink Prison M... 0.982253
08f194ad149044c6037575af3681766f {'primary': 'Philip Simpson Des... 0.969941
08f194ad30695784036410e184708927 {'primary': 'Clink Street Londo... 0.965185
Source code in overturemaestro/functions.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
|
convert_geometry_to_geodataframe_for_multiple_types ¶
convert_geometry_to_geodataframe_for_multiple_types(
theme_type_pairs: list[tuple[str, str]],
geometry_filter: BaseGeometry,
release: Optional[str] = None,
*,
pyarrow_filters: Optional[list[Optional[PYARROW_FILTER]]] = None,
columns_to_download: Optional[list[Optional[list[str]]]] = None,
ignore_cache: bool = False,
working_directory: Union[str, Path] = "files",
verbosity_mode: VERBOSITY_MODE = "transient",
max_workers: Optional[int] = None
) -> list[gpd.GeoDataFrame]
Get GeoDataFrames list with Overture Maps data within given geometry for multiple types.
Automatically downloads Overture Maps dataset for a given release and theme/type pairs in a concurrent manner and returns a list of GeoDataFrames as a result.
Order of GeoDataFrames is the same as the input theme_type_pairs list.
PARAMETER | DESCRIPTION |
---|---|
theme_type_pairs |
Pairs of themes and types of the dataset.
TYPE:
|
geometry_filter |
Geometry used to filter data.
TYPE:
|
release |
Release version. If not provided, will automatically load newest available release version. Defaults to None.
TYPE:
|
pyarrow_filters |
A list of pyarrow expressions used to filter specific theme type pair. Must be the same length as the list of theme type pairs. Defaults to None.
TYPE:
|
columns_to_download |
A list of pyarrow expressions used to filter specific theme type pair. Must be the same length as the list of theme type pairs. Defaults to None.
TYPE:
|
ignore_cache |
Whether to ignore precalculated geoparquet files or not. Defaults to False.
TYPE:
|
working_directory |
Directory where to save
the downloaded
TYPE:
|
verbosity_mode |
Set progress verbosity mode. Can be one of: silent, transient and verbose. Silent disables output completely. Transient tracks progress, but removes output after finished. Verbose leaves all progress outputs in the stdout. Defaults to "transient".
TYPE:
|
max_workers |
Max number of multiprocessing workers used to process the dataset. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[GeoDataFrame]
|
list[gpd.GeoDataFrame]: List of GeoDataFrames with Overture Maps features. |
Source code in overturemaestro/functions.py
convert_geometry_to_parquet ¶
convert_geometry_to_parquet(
theme: str,
type: str,
geometry_filter: BaseGeometry,
release: Optional[str] = None,
*,
pyarrow_filter: Optional[PYARROW_FILTER] = None,
columns_to_download: Optional[list[str]] = None,
result_file_path: Optional[Union[str, Path]] = None,
ignore_cache: bool = False,
working_directory: Union[str, Path] = "files",
verbosity_mode: VERBOSITY_MODE = "transient",
max_workers: Optional[int] = None
) -> Path
Get a GeoParquet file with Overture Maps data within given geometry.
Automatically downloads Overture Maps dataset for a given release and theme/type in a concurrent manner and returns a single file as a result.
PARAMETER | DESCRIPTION |
---|---|
theme |
Theme of the dataset.
TYPE:
|
type |
Type of the dataset.
TYPE:
|
geometry_filter |
Geometry used to filter data.
TYPE:
|
release |
Release version. If not provided, will automatically load newest available release version. Defaults to None.
TYPE:
|
pyarrow_filter |
Filters to apply on a pyarrow dataset. Can be pyarrow.compute.Expression or List[Tuple] or List[List[Tuple]]. Defaults to None.
TYPE:
|
columns_to_download |
List of columns to download. Automatically adds geometry column to the list. If None, will download all columns. Defaults to None.
TYPE:
|
result_file_path |
Where to save the geoparquet file. If not provided, will be generated based on hashes from filters. Defaults to None.
TYPE:
|
ignore_cache |
Whether to ignore precalculated geoparquet files or not. Defaults to False.
TYPE:
|
working_directory |
Directory where to save
the downloaded
TYPE:
|
verbosity_mode |
Set progress verbosity mode. Can be one of: silent, transient and verbose. Silent disables output completely. Transient tracks progress, but removes output after finished. Verbose leaves all progress outputs in the stdout. Defaults to "transient".
TYPE:
|
max_workers |
Max number of multiprocessing workers used to process the dataset. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Path
|
Path to the generated GeoParquet file.
TYPE:
|
Examples:
Get buildings in the center of London.
>>> import overturemaestro as om
>>> from shapely import box
>>> london_bbox = box(-0.120077, 51.498164, -0.090809, 51.508849)
>>> gpq_path = om.convert_geometry_to_parquet(
... release="2024-08-20.0",
... theme="buildings",
... type="building",
... geometry_filter=london_bbox,
... )
>>> gpq_path.as_posix()
'files/2024-08-20.0/theme=buildings/type=building/7ed11f0d_nofilter.parquet'
Inspect the content
>>> import geopandas as gpd
>>> gdf = gpd.read_parquet(gpq_path)
>>> len(gdf)
1863
>>> list(gdf.columns)
['id', 'geometry', 'bbox', 'version', 'sources', 'subtype', 'class', 'names', 'level',
'has_parts', 'height', 'is_underground', 'num_floors', 'num_floors_underground',
'min_height', 'min_floor', 'facade_color', 'facade_material', 'roof_material', 'roof_shape',
'roof_direction', 'roof_orientation', 'roof_color', 'roof_height', 'theme', 'type']
Download museums in the same area from places dataset with a filter.
>>> gpq_path = om.convert_geometry_to_parquet(
... release="2024-08-20.0",
... theme="places",
... type="place",
... geometry_filter=london_bbox,
... pyarrow_filter=[[
... (("categories", "primary"), "=", "museum"),
... ("confidence", ">", 0.95),
... ]],
... )
>>> gdf = gpd.read_parquet(gpq_path)
>>> len(gdf)
5
>>> gdf[["id", "names", "confidence"]]
id names confidence
0 08f194ad1499c8b1038ff3e213d81456 {'primary': 'Florence Nightinga... 0.982253
1 08f194ad149044c6037575af3681766f {'primary': 'Philip Simpson Des... 0.969941
2 08f194ad32a0d494030fdddc1b405fb1 {'primary': 'Shakespeare's Glob... 0.991993
3 08f194ad30695784036410e184708927 {'primary': 'Clink Street Londo... 0.965185
4 08f194ad30690a42034312e00c0254a2 {'primary': 'The Clink Prison M... 0.982253
Source code in overturemaestro/functions.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 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 195 196 |
|
convert_geometry_to_parquet_for_multiple_types ¶
convert_geometry_to_parquet_for_multiple_types(
theme_type_pairs: list[tuple[str, str]],
geometry_filter: BaseGeometry,
release: Optional[str] = None,
*,
pyarrow_filters: Optional[list[Optional[PYARROW_FILTER]]] = None,
columns_to_download: Optional[list[Optional[list[str]]]] = None,
ignore_cache: bool = False,
working_directory: Union[str, Path] = "files",
verbosity_mode: VERBOSITY_MODE = "transient",
max_workers: Optional[int] = None
) -> list[Path]
Get GeoParquet files with Overture Maps data within given geometry for multiple types.
Automatically downloads Overture Maps dataset for a given release and theme/type pairs in a concurrent manner and returns a list of files as a result.
Order of paths is the same as the input theme_type_pairs list.
PARAMETER | DESCRIPTION |
---|---|
theme_type_pairs |
Pairs of themes and types of the dataset.
TYPE:
|
geometry_filter |
Geometry used to filter data.
TYPE:
|
release |
Release version. If not provided, will automatically load newest available release version. Defaults to None.
TYPE:
|
pyarrow_filters |
A list of pyarrow expressions used to filter specific theme type pair. Must be the same length as the list of theme type pairs. Defaults to None.
TYPE:
|
columns_to_download |
A list of pyarrow expressions used to filter specific theme type pair. Must be the same length as the list of theme type pairs. Defaults to None.
TYPE:
|
ignore_cache |
Whether to ignore precalculated geoparquet files or not. Defaults to False.
TYPE:
|
working_directory |
Directory where to save
the downloaded
TYPE:
|
verbosity_mode |
Set progress verbosity mode. Can be one of: silent, transient and verbose. Silent disables output completely. Transient tracks progress, but removes output after finished. Verbose leaves all progress outputs in the stdout. Defaults to "transient".
TYPE:
|
max_workers |
Max number of multiprocessing workers used to process the dataset. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
list[Path]
|
list[Path]: List of paths to the generated GeoParquet files. |