Skip to content

Add GraphHopper routing by date for OHM - #893

Merged
Rub21 merged 5 commits into
stagingfrom
routing
Oct 21, 2026
Merged

Rub21 merged 5 commits into
stagingfrom
routing

Conversation

@Rub21

@Rub21 Rub21 commented Oct 21, 2026

Copy link
Copy Markdown
Member

I added a routing service that uses only the ways that existed on a given date. It runs GraphHopper with a small plugin that reads start_date and end_date from each way. A CronJob applies minute diffs every 2 hours, builds a new graph and restarts the server with no downtime. It is enabled in staging and disabled in production, and I checked the chart with helm lint and helm template.

How it works:

First install

  • On the first start, the server downloads the OHM planet file, updates it with the minute diffs and builds the graph. This takes a few minutes.

Update

  • A CronJob runs every 2 hours and adds the new minute diffs to the planet file. If there is no new data, the job stops.
  • If there is new data, the job builds a new graph in a new folder and switches current to it. Then it restarts the server. The new pod loads the new graph before the old pod stops, so there is no downtime.
  • Every 7 days the job downloads a new planet file instead of using diffs.

For now the plugin only reads dates from ways, not from relations. About 1% of ways have dates only on a relation, so the router treats them as ways with no dates.

Ref OpenHistoricalMap/issues#506, OpenHistoricalMap/issues#695

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant