Combined Render: Full-Featured Example
The most comprehensive example demonstrating all terrain-maker features in one pipeline.

Overview
This example combines:
Dual colormaps (sledding + XC skiing)
Road rendering with glossy materials
Print-quality output
Advanced DEM smoothing
Pipeline caching
Quick Start
# Fast preview
python examples/detroit_combined_render.py
# Print quality (14x10 inches @ 72 DPI)
python examples/detroit_combined_render.py --print-quality
# With roads
python examples/detroit_combined_render.py --roads --smooth
Example Image Command
The example image shown above was generated with:
uv run python examples/detroit_combined_render.py \
--print-quality \
--print-width 14 \
--print-height 10 \
--print-dpi 72 \
--ortho-scale 0.9 \
--height-scale 4.0 \
--sun-energy 0.5 \
--sky-intensity 0.9 \
--air-density 0.1 \
--camera-direction south \
--camera-elevation 2.5 \
--vertex-multiplier 1 \
--roads \
--road-color azurite \
--output-dir docs/images/combined_render
Feature Categories
Dual Colormap System
Blend two score layers with proximity masking:
from src.terrain.core import Terrain
from src.terrain.color_mapping import elevation_colormap
# Base layer: sledding scores (everywhere)
# Overlay: XC skiing scores (near parks only)
terrain.set_blended_color_mapping(
base_colormap=lambda s: elevation_colormap(s, cmap_name='mako'),
base_source_layers=['sledding'],
overlay_colormap=lambda s: elevation_colormap(s, cmap_name='rocket'),
overlay_source_layers=['xc_skiing'],
overlay_mask=park_proximity_mask
)
Key function: set_blended_color_mapping()
Road Rendering
python examples/detroit_combined_render.py \
--roads \
--road-types motorway trunk primary \
--road-color azurite \
--road-width 3
Key functions:
add_roads_layer()- Add roads as data layersmooth_road_vertices()- Smooth road elevationsapply_terrain_with_obsidian_roads()- Glossy road material
DEM Smoothing
Multiple smoothing options can be combined:
# Wavelet denoising (best for sensor noise)
--wavelet-denoise --wavelet-type db4 --wavelet-levels 3
# Slope-adaptive (smooths flat areas, preserves hills)
--adaptive-smooth --adaptive-slope-threshold 2.0
# Bump removal (removes buildings/trees)
--remove-bumps 2 --remove-bumps-strength 0.7
Key functions:
wavelet_denoise_dem()slope_adaptive_smooth()remove_bumps()
Camera & Lighting
--camera-direction south \
--sun-azimuth 225 \
--sun-elevation 30 \
--hdri-lighting
Key functions:
position_camera_relative()setup_hdri_lighting()setup_two_point_lighting()
Print Quality
python examples/detroit_combined_render.py \
--print-quality \
--print-dpi 300 \
--print-width 18 \
--print-height 12 \
--format jpeg \
--embed-profile
Key function: render_scene_to_file()
CLI Reference
Basic Options
Flag |
Default |
Description |
|---|---|---|
|
|
Output directory |
|
False |
Use mock data |
|
False |
Skip rendering |
Quality Options
Flag |
Default |
Description |
|---|---|---|
|
False |
High-res mode |
|
300 |
Print resolution |
|
auto |
Mesh detail |
Smoothing Options
Flag |
Description |
|---|---|
|
Bilateral smoothing |
|
Wavelet denoising |
|
Slope-adaptive |
|
Morphological |
|
Median filter |
Road Options
Flag |
Default |
Description |
|---|---|---|
|
False |
Enable roads |
|
motorway trunk primary |
OSM types |
|
azurite |
Color preset |
|
3 |
Width in pixels |
Advanced Mesh Features
Two-Tier Edge Extrusion
# Basic two-tier edge with clay base
python examples/detroit_combined_render.py --two-tier-edge
# Custom base material (obsidian, chrome, plastic, gold, ivory)
python examples/detroit_combined_render.py \
--two-tier-edge \
--edge-base-material gold
# Custom RGB base color (0-1 range)
python examples/detroit_combined_render.py \
--two-tier-edge \
--edge-base-material "0.6,0.55,0.5"
# Disable color blending for sharp transition
python examples/detroit_combined_render.py \
--two-tier-edge \
--no-edge-blend-colors
Key functions:
create_boundary_extension()- Create edge geometry
Boundary Smoothing
# Catmull-Rom curve smoothing (eliminates pixel staircase)
python examples/detroit_combined_render.py \
--two-tier-edge \
--use-catmull-rom
# Custom smoothness (higher = smoother, more vertices)
python examples/detroit_combined_render.py \
--two-tier-edge \
--use-catmull-rom \
--catmull-rom-subdivisions 20
# Combine with morphological smoothing
python examples/detroit_combined_render.py \
--two-tier-edge \
--use-catmull-rom \
--smooth-boundary
Edge Detection Methods
# Rectangle-edge sampling (150x faster than morphological)
python examples/detroit_combined_render.py \
--two-tier-edge \
--use-rectangle-edges
# Fractional edges (preserve projection curvature)
python examples/detroit_combined_render.py \
--two-tier-edge \
--use-rectangle-edges \
--use-fractional-edges
Edge methods:
Morphological (default): Accurate but slower
Rectangle (
--use-rectangle-edges): Fast approximationFractional (
--use-fractional-edges): Smooth curved boundaries from UTM projection
Pipeline Architecture
Load DEM → Transform → Detect Water → Smooth → Add Layers → Color → Mesh → Render
Load: DEM + score grids + parks + roads
Transform: Reproject, flip, downsample
Water: Slope-based detection (before smoothing)
Smooth: Wavelet/adaptive/bilateral
Layers: Align scores and roads to DEM
Color: Dual colormap with proximity mask
Mesh: Create vertices with colors
Render: Camera, lights, background, output
See Also
Great Lakes Elevation Visualization - Basic terrain
Snow Integration: Sledding Location Analysis - Snow analysis
PipelineCache()- Caching system