visualize_edgedata_tool
Generate heatmaps from SUMO edge data to analyze traffic attributes across multiple simulations using auto, unified, or fixed scales.
Instructions
🎨 Visualize SUMO edgedata with flexible scaling modes for comparison.
⚠️ IMPORTANT: Only use when user EXPLICITLY requests heatmap/visualization!
- User says "show heatmap", "visualize density", "show congestion map" → Use this
- User asks "which road is congested?" -> Do NOT use; answer with text from SQL query
**SCALE MODES:**
1. **'auto'** (default): Dynamic scale from current file
- Best for: Single simulation analysis
- Scale: Optimized for current data range
2. **'unified'**: Consistent scale across multiple files
- Best for: Policy comparison (before/after)
- Requires: comparison_files parameter
- Example: Compare baseline vs policy A vs policy B
3. **'fixed'**: User-defined fixed scale
- Best for: Standardized reports, academic papers
- Requires: min_value and max_value parameters
- Example: Always use [0, 100] for all simulations
**USE CASES:**
# Single simulation analysis (auto scale)
visualize_edgedata_tool(..., scale_mode="auto")
→ Optimized color contrast for this simulation
# Policy comparison (unified scale)
visualize_edgedata_tool(
edgedata_file="after.xml",
scale_mode="unified",
comparison_files=["before.xml"]
)
→ Same colors mean same values across both
# Standardized scale (fixed)
visualize_edgedata_tool(..., scale_mode="fixed", min_value=0, max_value=100)
→ All simulations use [0, 100] scale
Args:
net_file: Path to the SUMO network file (.net.xml)
edgedata_file: Path to the SUMO edgeData output file (.xml)
attribute: Attribute to visualize (e.g., 'density', 'speed', 'CO2_abs')
output_dir: Output directory for visualization files
scale_mode: Scale mode ('auto' | 'unified' | 'fixed')
comparison_files: List of files for unified scale (for 'unified' mode)
min_value: Minimum value for fixed scale (for 'fixed' mode)
max_value: Maximum value for fixed scale (for 'fixed' mode)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| net_file | Yes | ||
| attribute | No | density | |
| max_value | No | ||
| min_value | No | ||
| output_dir | No | output/visualizations | |
| scale_mode | No | auto | |
| edgedata_file | Yes | ||
| comparison_files | No |