Table of Contents¶
- georouting.utils
- convert_to_list
- get_batch_od_pairs
- build_geofabrik_region_index
- build_geofabrik_catalog
- resolve_geofabrik_pbf
- render_osrm_dockerfile
- write_osrm_dockerfile
- build_osrm_image
- run_osrm_container
- build_and_run_osrm
georouting.utils¶
convert_to_list¶
1 | |
This function converts the data to a list.
get_batch_od_pairs¶
1 | |
This function returns a list of dataframes containing the origin-destination pairs to avoid the repeated requests to the travel distance API.
build_geofabrik_region_index¶
1 2 3 4 5 6 7 | |
Build a mapping of region slug -> {url, size_bytes?, size_gb?} using Geofabrik index-v1.json. Saves to cache_path (JSON) for reuse unless refresh=True.
build_geofabrik_catalog¶
1 2 3 4 5 6 7 | |
Return a list of all Geofabrik PBF datasets with URLs (and sizes if requested). Caches the result to JSON for reuse.
resolve_geofabrik_pbf¶
1 | |
Resolve a region string to a Geofabrik PBF URL using the catalog; fallback to slug/path.
render_osrm_dockerfile¶
1 2 3 4 5 6 7 | |
Render a Dockerfile string for an OSRM backend for the given region/profile.
Parameters¶
region : str Geofabrik region slug/path (e.g., "north-america/us/massachusetts"). port : int Port to expose in the container. base_image : str OSRM base image to use. auto_fetch : bool If True, refresh Geofabrik index when resolving region. prefer_html : bool Unused here; kept for parity with resolver options. size_timeout : int Timeout (seconds) for size resolution (currently unused in rendering). profile : str OSRM profile name or path (e.g., "car", "foot", "bicycle" or a lua path).
write_osrm_dockerfile¶
1 | |
Write the rendered OSRM Dockerfile to disk and print a preview.
build_osrm_image¶
1 2 3 | |
Build the OSRM Docker image using the given Dockerfile and context.
run_osrm_container¶
1 2 3 4 | |
Run the OSRM container exposing the selected port.
build_and_run_osrm¶
1 2 3 4 5 6 7 8 9 10 11 12 | |
One-shot: write Dockerfile, build image, run container for the given region.