Skip to content

Latest commit

 

History

History
225 lines (182 loc) · 6.13 KB

File metadata and controls

225 lines (182 loc) · 6.13 KB

Latvia OSM Road Completeness Map - Final Status

Project Cleaned ✓

All temporary test and development scripts have been removed. The project now contains only essential production files.


Current Data Status

Total Coverage

  • 42 Features on map (36 municipalities + 6 cities)
  • 39 Features with data (complete or partial)
  • 3 Features without data

Municipalities (36)

  • ✅ All 36 municipalities have complete data
  • ✅ All have OSM data + official 2024 road statistics
  • ✅ Completeness calculated for all

Cities (7)

City Status OSM (km) Official (km) Completeness
Jelgava ✅ Complete 3,315.65 1,552 213.6%
Rēzekne ✅ Complete 4,190.27 2,651 158.1%
Ventspils ✅ Complete 4,948.60 1,455 340.1%
Rīga ⏳ Official Only 1,205
Daugavpils ⏳ Official Only 333
Jūrmala ⏳ Official Only 399
Liepāja ⏳ Official Only 271

Areas Without Data (3)

  • Salaspils novads
  • Jelgavas (novads - duplicate)
  • Rēzeknes (novads - duplicate)

Data Files

Core Outputs

  • completeness_municipalities.csv

    • 39 records
    • All 36 municipalities with complete data
    • 3 cities with complete data (Jelgava, Rēzekne, Ventspils)
    • 4 cities with official data only (Rīga, Daugavpils, Jūrmala, Liepāja)
  • latvia_lau1.geojson

    • 42 features (all boundaries)
    • 39 with completeness data
    • 3 without data (marked for visual distinction)
  • interactive_map.html

    • 10.39 MB interactive web map
    • Served by Flask at http://localhost:5000/lau1-map
    • Color-coded by completeness percentage
    • Click features to see detailed statistics

How to Run

Start the Web Server

python app.py

Access the Map

  • Main URL: http://localhost:5000/lau1-map
  • Alternative: http://localhost:5000/
  • Direct HTML: Open outputs/maps/interactive_map.html in browser

Data Processing

Scripts in scripts/ directory:

  • 00_convert_official_stats.py - Convert official statistics
  • 02_extract_roads.py - Extract OSM roads
  • 03_process_municipalities.py - Process municipality data
  • 04_spatial_join.py - Spatial operations
  • 05_calculate_completeness.py - Calculate completeness
  • 07_create_interactive_map.py - Legacy map generation
  • 08_create_lau1_map.py - Generate current LAU1 map
  • 99_create_comprehensive_geojson.py - Merge data into comprehensive GeoJSON

Statistics

Completeness Overview

  • Average: 249.6% (very high OSM coverage)
  • Best Mapped: Olaine (645.6%)
  • Least Mapped: Varakļāni (120.4%)
  • Over-mapped (>100%): 35 areas
  • Fully mapped (80-100%): 0 areas
  • Under-mapped (<50%): 0 areas

Top 5 Best Mapped

  1. Olaine - 645.6%
  2. Ropaži - 478.1%
  3. Ādaži - 466.6%
  4. Mārupe - 420.3%
  5. Ķekava - 395.4%

Top 5 Least Mapped

  1. Varakļāni - 120.4%
  2. Preiļi - 152.2%
  3. Ludza - 152.7%
  4. Rēzekne - 158.1%
  5. Krāslava - 166.7%

Map Features

Interactive Features

  • 🗺️ Zoom & Pan: Full Leaflet controls
  • 🖱️ Click Features: View detailed statistics in popup
  • 🎨 Color Coded: Green (low) → Yellow → Red → Purple (high)
  • 📍 CartoDB Base Map: Professional tile background

Popup Information

For each area:

  • Name and ISO code
  • OSM road length (km)
  • Official road length (km)
  • Completeness percentage (where available)
  • Data availability flag

Next Steps (Optional)

To complete OSM data for the 4 remaining cities, run:

python extract_city_osm.py

This will:

  1. Spatially clip OSM roads to city boundaries
  2. Calculate total OSM length for each city
  3. Generate completeness percentages
  4. Update CSV and regenerate map

Note: This operation is computationally intensive (~5-10 minutes).


Files Cleaned

Removed 23 temporary development scripts:

  • add_city_data.py
  • add_missing_cities.py
  • analyze_geojson.py
  • analyze_missing_data.py
  • calculate_city_osm.py
  • check_all_features.py
  • check_cities_status.py
  • check_cities.py
  • check_city_osm_data.py
  • check_geojson_structure.py
  • check_map.py
  • check_ventspils_raw.py
  • check_ventspils.py
  • city_integration_summary.py
  • city_osm_output.txt
  • clean_duplicate_cities.py
  • extract_city_osm.py
  • fix_duplicate_ventspils.py
  • list_municipalities.py
  • show_cities.py
  • test_cities.py
  • update_official_data.py
  • CITY_DATA_INTEGRATION.md

Project Structure

latvia_osm_project/
├── app.py                              # Flask web application
├── requirements.txt                    # Python dependencies
├── README.md, CHANGELOG.md, LICENSE    # Documentation
├── run.ps1, setup.ps1                  # Startup scripts
│
├── data/
│   ├── raw/                            # Source GeoJSON files
│   └── processed/                      # Processed shapefiles and GeoJSON
│
├── scripts/                            # Data processing pipeline
│   ├── 00_convert_official_stats.py
│   ├── 02_extract_roads.py
│   ├── ...
│   ├── 08_create_lau1_map.py          # Main map generation
│   └── 99_create_comprehensive_geojson.py
│
├── outputs/
│   ├── exports/
│   │   ├── completeness_municipalities.csv
│   │   └── latvia_lau1.geojson
│   └── maps/
│       └── interactive_map.html
│
├── src/
│   └── processing/                     # Python modules
│
├── templates/                          # HTML templates
│
└── docs/                               # Documentation

Status Summary

Project CleanedAll 36 Municipalities with Data7 Cities Integrated (3 complete, 4 official-only) ✅ Map Generated & RunningFlask Server ActiveOSM Data for 4 Cities Pending (optional)


Last Updated: January 22, 2026
Map Endpoint: http://localhost:5000/lau1-map