{"id":20986899,"url":"https://github.com/christippett/bigquery-geo-router","last_synced_at":"2025-10-30T05:08:41.308Z","repository":{"id":89854606,"uuid":"258783046","full_name":"christippett/bigquery-geo-router","owner":"christippett","description":"Calculate routes from long/lat coordinates in BigQuery using OpenStreetMap/OSRM","archived":false,"fork":false,"pushed_at":"2020-09-12T20:03:21.000Z","size":176,"stargazers_count":9,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-30T02:45:16.413Z","etag":null,"topics":["bigquery","geospatial","google","openstreetmap","osrm"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/christippett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-25T13:31:08.000Z","updated_at":"2025-02-25T21:34:22.000Z","dependencies_parsed_at":"2023-06-15T21:30:14.575Z","dependency_job_id":null,"html_url":"https://github.com/christippett/bigquery-geo-router","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"674f09daa341caf77c824160155c1a306de099a8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/christippett/bigquery-geo-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christippett%2Fbigquery-geo-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christippett%2Fbigquery-geo-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christippett%2Fbigquery-geo-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christippett%2Fbigquery-geo-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christippett","download_url":"https://codeload.github.com/christippett/bigquery-geo-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christippett%2Fbigquery-geo-router/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281748716,"owners_count":26554822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bigquery","geospatial","google","openstreetmap","osrm"],"created_at":"2024-11-19T06:15:19.609Z","updated_at":"2025-10-30T05:08:41.277Z","avatar_url":"https://github.com/christippett.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BigQuery Geo Router\n\nConverts a series of long/lat coordinates in BigQuery into routes generated using [OpenStreetMap data](https://www.openstreetmap.org/) and the [Open Source Routing Machine](http://project-osrm.org/).\n\nThe resulting data can be loaded back into BigQuery for further analysis - each route is typed appropriately to be used with BigQuery's [geospatial querying functionality](https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions). \n\n## Usage\n\n### Setup\n\nThe first step is to download and prepare the OpenStreetMap data for the region you're interested in calculating routes for.\n\n[Geofabrik](https://download.geofabrik.de/) has a number of regional OpenStreetMap extracts that can be used as our starting point. The included Cloud Build config, `cloudbuild-setup.yaml`, takes care of many the of steps you need to get everything set up.\n\nThe two main parameters needed for the Cloud Build job are `_OSM_NAME` and `_DATA_BUCKET`.\n\n- `_OSM_NAME`: this is the name, including any prefixes, for the OpenStreetMap data file available from Geofabrik (the Cloud Build job is configured to download extracts from this location). The example below is referencing the data for Illinois available [here](https://download.geofabrik.de/north-america/us/illinois.html) (note the URL path and its correlation to `_OSM_NAME`).\n- `_DATA_BUCKET`: the name of the Google Cloud Storage bucket where the resulting files will be saved and referenced when calculating routes.\n\n\n```bash\ngcloud builds submit \\\n    --config cloudbuild-setup.yaml \\\n    --substitutions=_OSM_NAME=north-america/us/illinois \\\n    --substitutions=_DATA_BUCKET=gs://my-bucket-for-storing-routing-data\n```\n\n### Generating Routes\n\nOnce the above step is complete, routes can be calculated by running (another) Cloud Build job. The job builds a Docker container containing a Node.js application that queries BigQuery and runs the routing calculation process. The resulting routes are output to a local JSON file that can subsequently be loaded back into BigQuery.\n\nThe input to the route calculator can either be a reference to a table in BigQuery (in the format `dataset.table`) or the path to a SQL file.\n\n```bash\ngcloud builds submit \\\n    --config cloudbuild.yaml \\\n    --substitutions=_OSM_NAME=north-america/us/illinois \\\n    --substitutions=_DATA_BUCKET=gs://my-bucket-for-storing-routing-data\n    --substitutions=_DESTINATION_DATASET=trip_routes \\\n    --substitutions=_INPUT_TABLE=trip_routes.trips\n```\n\n## Visualising Routes\n\nTBC\n\n## Configuring OSRM\n\nTBC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristippett%2Fbigquery-geo-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristippett%2Fbigquery-geo-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristippett%2Fbigquery-geo-router/lists"}