[FEATURE] Add travel_time property to water segments - #712
[FEATURE] Add travel_time property to water segments#712Alex Iannicelli (atiannicelli) wants to merge 1 commit into
Conversation
Adds an optional travel_time property (integer seconds, minimum 1) to the water subtype in both the Pydantic WaterSegment model and the YAML JSON Schema, capturing the scheduled end-to-end crossing time sourced from the OSM duration tag on ferry routes. Includes examples, counterexamples, regenerated JSON Schema baseline, changelog fragment, and a docs note. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Alex Iannicelli <atiannicelli@gmail.com>
🗺️ Schema reference docs preview is live!
Note ♻️ This preview updates automatically with each push to this PR. |
There was a problem hiding this comment.
🟢 Approval recommended
The schemas, documentation, generated baseline, and positive and negative examples consistently implement the requested behavior.
Pull request overview
Adds optional ferry crossing duration metadata to water segments so routers can calculate realistic ETAs.
Changes:
- Adds positive integer
travel_timevalidation to both schemas. - Documents the property and supplies examples/counterexamples.
- Regenerates the schema baseline and adds a changelog entry.
File summaries
| File | Description |
|---|---|
schema/transportation/segment.yaml |
Defines water-only travel_time. |
packages/.../segment/water.py |
Adds the Pydantic field and type. |
packages/.../segment_baseline_schema.json |
Updates the generated schema baseline. |
docs/schema/reference/transportation/segment.mdx |
Documents water travel time. |
packages/.../changelog.d/711.feature.md |
Records the feature. |
examples/.../water-ferry.yaml |
Adds a valid schema example. |
reference/examples/.../water-ferry.yaml |
Adds a valid Pydantic example. |
counterexamples/.../bad-travel-time-zero.yaml |
Tests the positive-value constraint. |
counterexamples/.../bad-travel-time-type.yaml |
Tests integer typing. |
counterexamples/.../bad-travel-time-wrong-subtype.yaml |
Tests water-only applicability. |
reference/counterexamples/.../bad-travel-time-zero.yaml |
Tests Pydantic positivity validation. |
reference/counterexamples/.../bad-travel-time-type.yaml |
Tests Pydantic integer validation. |
reference/counterexamples/.../bad-travel-time-wrong-subtype.yaml |
Tests Pydantic subtype validation. |
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
I believe this should be an extension instead of part of the base schema. My thinking is that we really only have one source for this data that I am aware of, OSM. I would like to see us examine multiple sources and ensure that our schema selection aligns before bringing this in. |
|
Are there directions on how to make an extension? Should all speed limit info be converted into an extension? |
Description
Adds an optional
travel_timeproperty tosubtype=watertransportation segments. The property is a positive integer number of seconds capturing the scheduled end-to-end crossing time for the full segment — including time spent docking, loading, and unloading — matching the semantics of the OSMdurationtag on ferry routes it is sourced from.Without it, routers consuming Overture fall back to a default ferry speed (~5 km/h), so car ferries are either avoided or produce wildly inflated ETAs.
Design choices follow the suggestions in the issue (open for working group review on this draft):
minimum: 1) — simplest for consumers.defs.yaml.Changes
packages/overture-schema-theme-transportation/.../segment/water.py: newTravelTimetype (int32,ge=1) and optionaltravel_timefield onWaterSegment.schema/transportation/segment.yaml: newtravelTimeproperty definition and reference from the wateroneOfbranch (replacing the placeholder).segment_baseline_schema.jsonviamake update-baselines.water-ferry.yamland counterexamples (bad-travel-time-zero,bad-travel-time-type,bad-travel-time-wrong-subtype) in bothexamples/+counterexamples/andreference/examples/+reference/counterexamples/.changelog.d/711.feature.md(transportation theme package).docs/schema/reference/transportation/segment.mdxwater subtype tab.Reference
Testing
examples/transportation(pass, including newwater-ferry.yaml) andcounterexamples/transportation(all fail as expected, including the three new water counterexamples) againstschema/schema.yamlwith a draft 2020-12 validator.pytest packages/overture-schema-theme-transportation packages/overture-schema-validation— 474 passed (includes the JSON Schema baseline test and the reference examples/counterexamples).pytest -W error packages/ tests/— 3550 passed; PySpark suite (regenerated expressions including the new field) — 3151 passed under JDK 17.lint-only,mypy-only,docformat-only,doctest-only,check-namespaceall pass.Checklist
Documentation website
Docs preview for this PR.