feat(phase-12f): curved corridor DEM extraction#23
Merged
Conversation
…long_route
The case studies all showed urban routes exceed the straight-line
geodesic (Linea Roja 1.5x, Medellin 1.3x, Cablebus 2.2x). routes.py
already built curved 2-D paths (polyline / Catmull-Rom Bezier) but the
output was never wired into the DEM sampling path — every case study
fell back to the straight extract_profile_from_dem and ate the
route-length gap.
New extract_profile_along_route(dem, waypoints, *, sample_spacing_m,
kind='polyline'|'bezier'):
- Accepts raw (lon, lat) tuples OR ropeway.routes.Waypoint instances
- Builds a Route in local UTM (auto-zone), samples the DEM at each
arc-length step
- Returns a standard TerrainProfile whose distance axis is the
along-route arc length, ready to drop into optimize() unchanged
Two-waypoint calls collapse to the existing straight-line behaviour.
Tests: tests/test_curved_corridor.py — 6 new
- two-waypoint polyline ≡ extract_profile_from_dem
- intermediate waypoint lengthens corridor
- Bezier and polyline both exceed straight line
- returned profile.as_function() is callable + finite (optimizer
consumes it that way)
- tuple and Waypoint inputs interchangeable
- <2 waypoints raises ValueError
Full suite green (195/195); no regressions.
922c490 to
61a3a05
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The case studies all showed urban routes exceed the straight-line geodesic — Línea Roja 1.5×, Medellín 1.3×, Cablebús 2.2×.
routes.pyalready built curved 2-D paths (polyline / Catmull-Rom Bezier) but the output was never wired into the DEM sampling path; every case study fell back to the straightextract_profile_from_demand ate the route-length gap.API
Two-waypoint calls collapse to the existing
extract_profile_from_dembehaviour.Test plan
tests/test_curved_corridor.py— 6 new tests: two-waypoint ≡ straight, intermediate waypoint lengthens, Bezier ≥ straight, profile drops into optimizer, tuple/Waypoint interchangeable, fewer-than-2 raises