Python API
get_features(output_feature_class, overture_type, bbox, connect_timeout=None, request_timeout=None)
Retrieve data from Overture Maps and save it as an ArcGIS Feature Class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_feature_class
|
Union[str, Path]
|
Path to the output feature class. |
required |
overture_type
|
str
|
Overture feature type to retrieve. |
required |
bbox
|
tuple[float, float, float, float]
|
Bounding box to filter the data. Format: (minx, miny, maxx, maxy). |
required |
connect_timeout
|
int
|
Optional timeout in seconds for establishing a connection to the AWS S3. |
None
|
request_timeout
|
int
|
Optional timeout in seconds for waiting for a response from the AWS S3. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to the created feature class. |
Source code in src/overture_to_arcgis/__main__.py
get_spatially_enabled_dataframe(overture_type, bbox, connect_timeout=None, request_timeout=None)
Retrieve data from Overture Maps as an ArcGIS spatially enabled Pandas DataFrame.
Note
To see available overture types, use arcgis_overture.utils.get_all_overture_types().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
overture_type
|
str
|
Overture feature type to retrieve. |
required |
bbox
|
tuple[float, float, float, float]
|
Bounding box to filter the data. Format: (minx, miny, maxx, maxy). |
required |
connect_timeout
|
int
|
Optional timeout in seconds for establishing a connection to the Overture Maps service. |
None
|
request_timeout
|
int
|
Optional timeout in seconds for waiting for a response from the Overture Maps service. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
A spatially enabled pandas DataFrame containing the requested Overture Maps data. |
Source code in src/overture_to_arcgis/__main__.py
Module overture_to_arcgis.utils
add_alternate_category_field(features)
Add an 'alternate_category' field to the input features if it does not already exist, and calculate from the 'categories' field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
Union[Layer, str, Path]
|
The input feature layer or feature class. |
required |
Source code in src/overture_to_arcgis/utils/_arcgis.py
add_boolean_access_restrictions_fields(features, access_field='access_restrictions')
Add boolean access restriction fields to the input features based on the access_restrictions field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
Union[str, Path, Layer]
|
The input feature layer or feature class. |
required |
access_field
|
str
|
The name of the access restrictions field. |
'access_restrictions'
|
Source code in src/overture_to_arcgis/utils/_arcgis.py
add_h3_indices(features, resolution=9, h3_field=None)
Add an H3 index field to the input features based on their geometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
Union[str, Path, Layer]
|
The input feature layer or feature class. |
required |
resolution
|
int
|
The H3 resolution to use for indexing. |
9
|
h3_field
|
Optional[str]
|
The name of the H3 index field to add. |
None
|
Source code in src/overture_to_arcgis/utils/_arcgis.py
add_overture_taxonomy_fields(features, single_category_field=None)
Add 'category_single_category_field parameter.
Note
If a single category field is not provided, the function will attempt to read the value for the primary key from
string JSON in the categories field, if this field exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
Union[str, Path, Layer]
|
The input feature layer or feature class. |
required |
single_category_field
|
Optional[str]
|
The field name containing a single category. |
None
|
Source code in src/overture_to_arcgis/utils/_arcgis.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 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 | |
add_primary_category_field(features)
Add a 'primary_category' field to the input features if it does not already exist, and calculate from the 'categories' field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
Union[Layer, str, Path]
|
The input feature layer or feature class. |
required |
Source code in src/overture_to_arcgis/utils/_arcgis.py
add_primary_name(features)
Add a 'primary_name' field to the input features if it does not already exist, and calculate from
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
Union[Layer, str, Path]
|
The input feature layer or feature class. |
required |
Source code in src/overture_to_arcgis/utils/_arcgis.py
add_trail_field(features)
Add a 'trail' boolean field to the input features if it does not already exist. These features are those with a class of 'track', 'path', 'footway', 'trail' or 'cycleway' field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
Union[Layer, str, Path]
|
The input feature layer or feature class. |
required |
Source code in src/overture_to_arcgis/utils/_arcgis.py
add_website_field(features)
Add a 'website' field to the input features if it does not already exist, and calculate from the 'contact_info' field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
features
|
Union[Layer, str, Path]
|
The input feature layer or feature class. |
required |
Source code in src/overture_to_arcgis/utils/_arcgis.py
get_all_overture_types(release=None, s3=None)
Returns a list of all available Overture dataset types for a given release.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
release
|
Optional[str]
|
Optional release version. If not provided, the most current release will be used. |
None
|
s3
|
Optional[S3FileSystem]
|
Optional pre-configured S3 filesystem. If not provided, an anonymous S3 filesystem will be created. |
None
|
Returns:
| Type | Description |
|---|---|
list[str]
|
List of available overture types for the release. |
Source code in src/overture_to_arcgis/utils/__main__.py
get_current_release()
Returns the most current Overture dataset release string.
Returns:
| Type | Description |
|---|---|
str
|
Most current release string. |
Source code in src/overture_to_arcgis/utils/__main__.py
get_geometry_column(table)
Get the name of the geometry column from the PyArrow Table or RecordBatch metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Union[Table, RecordBatch]
|
PyArrow Table or RecordBatch with GeoArrow metadata. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Name of the geometry column. |
Source code in src/overture_to_arcgis/utils/__main__.py
get_layers_for_unique_values(input_features, field_name, arcgis_map=None)
Create layers from unique values in a specified field of the input features.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_features
|
Union[Layer, str, Path]
|
The input feature layer or feature class. |
required |
field_name
|
str
|
The field name to get unique values from. |
required |
arcgis_map
|
Optional[Map]
|
The ArcGIS map object to add the layers to. |
None
|
Returns:
| Type | Description |
|---|---|
list[Layer]
|
A list of ArcGIS layers created from the unique values. |
Source code in src/overture_to_arcgis/utils/_arcgis.py
get_logger(level='INFO', logger_name=None, logfile_path=None, log_format='%(asctime)s | %(name)s | %(levelname)s | %(message)s', propagate=True, add_stream_handler=True, add_arcpy_handler=False)
Get Python :class:Logger<logging.Logger> configured to provide stream, file or, if available, ArcPy output.
The way the method is set up, logging will be routed through ArcPy messaging using :class:ArcpyHandler if
ArcPy is available. If ArcPy is not available, messages will be sent to the console using a
:class:StreamHandler<logging.StreamHandler>. Next, if the logfile_path is provided, log messages will also
be written to the provided path to a logfile using a :class:FileHandler<logging.FileHandler>.
Valid log_level inputs include:
* DEBUG - Detailed information, typically of interest only when diagnosing problems.
* INFO - Confirmation that things are working as expected.
* WARNING or WARN - An indication that something unexpected happened, or indicative of some problem in the
near future (e.g. "disk space low"). The software is still working as expected.
* ERROR - Due to a more serious problem, the software has not been able to perform some function.
* CRITICAL - A serious error, indicating that the program itself may be unable to continue running.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
Optional[Union[str, int]]
|
Logging level to use. Default is |
'INFO'
|
logger_name
|
Optional[str]
|
Name of the logger. If |
None
|
log_format
|
Optional[str]
|
Format string for the logging messages. Default is |
'%(asctime)s | %(name)s | %(levelname)s | %(message)s'
|
propagate
|
bool
|
If |
True
|
logfile_path
|
Union[Path, str]
|
Where to save the logfile if file output is desired. |
None
|
add_stream_handler
|
bool
|
If |
True
|
add_arcpy_handler
|
bool
|
If |
False
|
configure_logging('DEBUG')
logging.debug('nauseatingly detailed debugging message')
logging.info('something actually useful to know')
logging.warning('The sky may be falling')
logging.error('The sky is falling.)
logging.critical('The sky appears to be falling because a giant meteor is colliding with the earth.')
Source code in src/overture_to_arcgis/utils/_logging.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 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 | |
get_record_batches(overture_type, bbox=None, connect_timeout=None, request_timeout=None)
Return a pyarrow RecordBatchReader for the desired bounding box and S3 path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
overture_type
|
str
|
Overture feature type to load. |
required |
bbox
|
Optional[Tuple[float, float, float, float]]
|
Optional bounding box for data fetch (xmin, ymin, xmax, ymax). |
None
|
connect_timeout
|
Optional[float]
|
Optional connection timeout in seconds. |
None
|
request_timeout
|
Optional[float]
|
Optional request timeout in seconds. |
None
|
Yields:
| Type | Description |
|---|---|
RecordBatch
|
pa.RecordBatch: Record batches with the requested data. |
Source code in src/overture_to_arcgis/utils/__main__.py
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 | |
get_release_list(s3=None)
Returns a list of all available Overture dataset releases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
s3
|
Optional[S3FileSystem]
|
Optional pre-configured S3 filesystem. If not provided, an anonymous S3 filesystem will be created. |
None
|
Source code in src/overture_to_arcgis/utils/__main__.py
get_temp_gdb()
Get a temporary File Geodatabase path.
Source code in src/overture_to_arcgis/utils/__main__.py
table_to_features(table, output_features)
Convert a PyArrow Table or RecordBatch with GeoArrow metadata to an ArcGIS Feature Class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Union[Table, RecordBatch]
|
PyArrow Table or RecordBatch with GeoArrow metadata. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to the created feature class. |
Source code in src/overture_to_arcgis/utils/__main__.py
table_to_spatially_enabled_dataframe(table)
Convert a PyArrow Table or RecordBatch with GeoArrow metadata to an ArcGIS Spatially Enabled DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Union[Table, RecordBatch]
|
PyArrow Table or RecordBatch with GeoArrow metadata. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
ArcGIS Spatially Enabled DataFrame. |
Source code in src/overture_to_arcgis/utils/__main__.py
validate_bounding_box(bbox)
Validate the bounding box coordinates.