Overture#

Module for loading and processing geospatial data from Overture Maps.

city2graph.overture.load_overture_data(area, types=None, output_dir='.', prefix='', save_to_file=True, return_data=True)[source]#

Load data from Overture Maps using the CLI tool and optionally save to GeoJSON files.

Can accept either a bounding box or a Polygon as the area parameter.

Parameters:
  • area (Union[List[float], Polygon]) – Either a bounding box as [min_lon, min_lat, max_lon, max_lat] in WGS84 coordinates or a Polygon in WGS84 coordinates (EPSG:4326). If provided in another CRS, it will be automatically transformed to WGS84. If a Polygon is provided, its bounding box will be used for the query and the results will be clipped to the Polygon boundaries.

  • types (Optional[List[str]], default=None) – Types of data to download. If None, downloads all available types. Must be valid Overture Maps data types: address, bathymetry, building, building_part, division, division_area, division_boundary, place, segment, connector, infrastructure, land, land_cover, land_use, water.

  • output_dir (str, default=".") – Directory to save the GeoJSON files

  • prefix (str, default="") – Prefix to add to the output filenames

  • save_to_file (bool, default=True) – Whether to save the data to GeoJSON files

  • return_data (bool, default=True) – Whether to return the data as GeoDataFrames

Returns:

Dictionary mapping types to GeoDataFrames if return_data is True, otherwise an empty dict

Return type:

Dict[str, gpd.GeoDataFrame]

Raises:

ValueError – If any of the provided types are not valid Overture Maps data types

Notes

The Overture Maps API requires coordinates in WGS84 (EPSG:4326) format. For more information, see https://docs.overturemaps.org/

city2graph.overture.process_overture_segments(segments_gdf, get_barriers=True, connectors_gdf=None, threshold=1.0)[source]#

Process segments from Overture Maps to be split by connectors and extract barriers.

Parameters:
  • segments_gdf (gpd.GeoDataFrame) – Input segments with ‘subtype’ and ‘level_rules’.

  • get_barriers (bool) – If True, add ‘barrier_geometry’ column to output.

  • connectors_gdf (Optional[gpd.GeoDataFrame]) – Connectors for splitting; if None connectors step is skipped.

  • threshold (float) – Distance threshold for adjusting connectors.

Returns:

Processed road segments, including ‘length’ and optional ‘barrier_geometry’.

Return type:

gpd.GeoDataFrame