The tool has been updated with a powerful multi-select interface for comparing municipalities across Latvia.
- Each municipality has a checkbox
- Click individual checkboxes to select/deselect
- "Select All" button - Choose all ~589 municipalities
- "Clear All" button - Deselect all municipalities
- Default: All municipalities are selected on page load
- When you open http://localhost:5000, Latvia is pre-selected
- All municipalities are automatically checked
- The map displays all municipalities
- The comparison table shows all data
Selected: 589 (count of checked municipalities)
Total Roads (OSM): 12,345.67 km (sum of all selected)
Total Segments: 98,765 (sum of all segments)
Avg Completeness: 42.3% (average of non-null values)
Shows data for each selected municipality:
| Municipality | OSM Roads | Segments | Completeness |
|---|---|---|---|
| Rīga | 1,234.56 km | 5,678 | 78.5% |
| Jūrmala | 123.45 km | 567 | 65.3% |
| Daugavpils | 234.56 km | 890 | 52.1% |
| ... | ... | ... | ... |
- Shows all selected municipalities highlighted in blue
- Map automatically fits to show all selected areas
- Updates instantly when you change selections
- Zoom and pan to explore details
- Open: http://localhost:5000
- All municipalities are pre-selected
- Map shows entire Latvia
- Statistics show national totals
- Click "Clear All" to deselect everything
- Select municipalities you want to compare by checking their boxes
- Watch the map update in real-time
- Review comparison statistics and table
- Select All: Check all municipalities at once
- Clear All: Uncheck all municipalities
- Individual: Click checkbox for each municipality
- View Top Municipalities: Sort table by completeness
- See Patterns: Compare neighboring municipalities
- Track Aggregates: Monitor totals as you select/deselect
# Get all GeoJSON features
curl http://localhost:5000/api/geojson-data
# Get all statistics
curl http://localhost:5000/api/csv-data// Load all data
const geoData = await fetch('/api/geojson-data').then(r => r.json());
const csvData = await fetch('/api/csv-data').then(r => r.json());
// Build lookup
const stats = {};
csvData.forEach(row => stats[row.municipality_name] = row);
// Filter for specific municipalities
const selected = ['Rīga', 'Jūrmala'];
const features = geoData.features.filter(f =>
selected.includes(f.properties.municipality_name)
);
// Calculate aggregates
const total = selected.reduce((sum, muni) =>
sum + (stats[muni]?.osm_road_km || 0), 0);- Better Performance: Select fewer municipalities to reduce map complexity
- Fast Selections: Use "Select All" / "Clear All" buttons for bulk operations
- Smooth Updates: All filtering happens in your browser (no server requests)
- Click "Clear All"
- Select: Rīga, Jūrmala, Daugavpils, Liepāja
- View comparison statistics
- Analyze road completeness patterns
- Click "Clear All"
- Select all municipalities in one region (e.g., Vidzeme region)
- Compare with national average shown in stats
- Export comparison data
- Keep "Select All" checked
- Review national statistics:
- Total road kilometers
- Average completeness
- Segment counts
- Spot-check individual municipalities for accuracy
| Issue | Solution |
|---|---|
| Checkboxes not visible | Scroll left sidebar down |
| Map not updating | Check browser console for errors |
| No data showing | Verify GeoJSON and CSV files exist |
| Slow performance | Reduce selected municipalities |
Future versions might add:
- Filters: By completeness category, road type, etc.
- Export: Download comparison as CSV or GeoJSON
- Historical: Compare data across different time periods
- Regional: Pre-grouped selections by administrative regions