Trail Route Editor

Design and optimize trail routes using real terrain data

Getting Started

1
Get terrain — In the US, click Get Terrain to download USGS elevation (1 m lidar where available) for your trails or the map view. Or click Load DEM and pick any GeoTIFF: UTM, lat/long, or State Plane, in meters or feet. The app builds a hillshade, contours, and 3D terrain from it.
2
Load or draw trails — Click Load Trails to import GPX, GeoJSON, KML/KMZ, or a zipped shapefile, or click New Route to draw one by clicking on the map.
3
Edit vertices — Select a trail from the dropdown. Drag vertices to reshape. Right-click a vertex to delete it. Click a segment midpoint to insert a new vertex.
4
Optimize — Click Optimize Route to run the spring-mass optimizer. It reshapes the trail to meet a target grade while following the terrain.
5
Save and export — Work is saved in this browser automatically. Use Save to download a project file, or export trails as GeoJSON, KML, or GPX.

App Layout

Top toolbar — Trail selector, basemap toggle, load/export/draw/optimize buttons
Map — Interactive map with hillshade, contours, and 3D terrain. Right-click drag to tilt.
Bottom panel — Elevation profile, slope profile, and trail stats. Drag the top edge to resize. Click the charts to zoom the map to that location.

Tips

🏷
Trail naming matters — Trails loaded with a Name or name property get listed individually in the selector. Trails without names are auto-assigned names like “Trail 1”.
❄
Freeze vertices before optimizing — Shift+click to freeze/unfreeze individual vertices (turns blue). Ctrl+Shift+click two vertices to freeze the range between them. Use “Freeze Flat” in the optimizer to auto-freeze segments already below 5% grade. Frozen vertices stay fixed during optimization.
📋
Optimizer creates a copy — Running the optimizer adds a new trail called “[name] - Optimized” so you can compare before and after side by side.
⚠
Target Grade vs Max Segment Grade — Target Grade sets the overall average. Max Segment Grade is a hard cap on any individual segment. Set target to 7% and max to 15% to allow some steepness while keeping the average reasonable.
🎯
Recenter if the map gets stuck — If zooming into 3D terrain makes the map unresponsive, click “Recenter” to reset the view.
⚡
Terrain is cached — Processing a DEM takes a few seconds; loading the same file again is instant. Storage shows what is kept and lets you delete it.
⌨
Keyboard shortcuts — Ctrl+Z undo vertex moves. While drawing: Ctrl+Z removes last point, Enter finishes, Esc cancels.
📡
Your files stay on your computer — Trails and DEMs are processed in your browser and never uploaded. Get Terrain sends only the area's bounding box to USGS. The local Python server is only needed for GeoPackage files.

Controls

Drag vertex
Click & drag a white dot
Add vertex
Right-click on trail line
Delete vertex
Right-click on vertex
Freeze vertex
Shift+click vertex (blue)
Freeze range
Ctrl+Shift+click two vertices
Add waypoint
Click Add Waypoint, click map
Delete waypoint
Right-click a waypoint marker
Tilt map (3D)
Right-click + drag on map
Zoom to point
Click on chart
Undo
Ctrl+Z