Skip to content

Latest commit

Β 

History

History
335 lines (256 loc) Β· 10.1 KB

File metadata and controls

335 lines (256 loc) Β· 10.1 KB

LatviaOSM-Check: OpenStreetMap Data Quality Analysis Tool

License: MIT Python 3.8+ Status: Active

Analyze, visualize, and understand OpenStreetMap data completeness across Latvia

🌍 Overview

LatviaOSM-Check is a comprehensive analysis tool that compares OpenStreetMap (OSM) data quality against official government statistics for Latvia. It provides interactive visualizations, statistical analysis, and detailed reports for three key geographic features:

  • πŸ›£οΈ Roads - Road networks and transport infrastructure
  • 🌲 Forests - Forest coverage and boundaries
  • πŸ“š Libraries - Library locations and cultural institutions

Key Features

βœ… Interactive Web Dashboard

  • Multi-layer interactive maps with color-coded completeness indicators
  • Real-time filtering and comparison tools
  • Hierarchical geographic selector (Country β†’ Region β†’ Municipality)
  • Click-to-explore detailed statistics

βœ… Data Analysis

  • Automatic comparison of OSM data vs official statistics
  • Completeness percentage calculations
  • Spatial join operations across 589+ geographic areas
  • Statistical aggregation by region (novads)

βœ… RESTful API

  • 15+ endpoints for programmatic data access
  • GeoJSON and CSV data export
  • Code examples in Python, JavaScript, and R

βœ… Professional Documentation

  • Complete installation guides (Windows, macOS, Linux, Docker)
  • User manual with common workflows
  • Developer guide for contributions
  • API reference with examples
  • Technical implementation details

πŸ“Š Current Data Status

Feature Coverage Records Status
Roads 36 municipalities 39/42 areas βœ… Complete
Forests Complete nationwide Multiple regions βœ… Complete
Libraries Complete nationwide Multiple regions βœ… Complete
Municipalities All 36 municipalities 36/36 βœ… Complete
Overall Completeness 249.6% average 42 features βœ… Excellent

πŸš€ Quick Start

Installation (5 minutes)

Windows:

git clone <repository-url>
cd latvia_osm_project
.\setup.ps1
.\run.ps1

Linux/macOS:

git clone <repository-url>
cd latvia_osm_project
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python app.py

Access the Application

Open your browser and navigate to:

πŸ“– Documentation

Complete documentation is available in the docs/ folder:

For Users

For Contributors

Project Information

πŸ’‘ Usage Examples

Web Interface

  1. Open http://localhost:5000 in your browser
  2. Select municipalities using the checkboxes
  3. View real-time statistics and map updates
  4. Click features for detailed information

Python API

import requests
import json

# Get all data as GeoJSON
response = requests.get('http://localhost:5000/api/geojson-data')
geojson = response.json()

# Get statistics CSV
response = requests.get('http://localhost:5000/api/csv-data')
csv_data = response.text

JavaScript/Node.js

// Fetch completeness data
fetch('http://localhost:5000/api/geojson-data')
  .then(res => res.json())
  .then(data => console.log(data.features[0]))

R

library(httr)

# Get completeness data
response <- GET('http://localhost:5000/api/geojson-data')
data <- content(response, as = 'parsed')

πŸ› οΈ Tech Stack

  • Backend: Flask, Python 3.8+
  • Data Processing: GeoPandas, Pandas, NumPy
  • Geospatial: Shapely, pyproj, GDAL
  • Frontend: Leaflet.js, HTML5, CSS3, JavaScript
  • Data Formats: GeoJSON, CSV, GeoTIFF, OSM PBF

πŸ“ Project Structure

latvia_osm_project/
β”œβ”€β”€ app.py                    # Flask web application
β”œβ”€β”€ src/                      # Source code modules
β”‚   └── processing/           # Data processing scripts
β”œβ”€β”€ scripts/                  # Pipeline scripts (numbered workflow)
β”œβ”€β”€ templates/                # Flask HTML templates
β”œβ”€β”€ data/                     # Data files (raw & processed)
β”œβ”€β”€ outputs/                  # Generated maps and exports
β”œβ”€β”€ docs/                     # Documentation
└── README.md                 # This file

See Project Structure for complete directory documentation.

🀝 Contributing

We welcome contributions from the community! Whether you want to:

  • Fix bugs
  • Add features
  • Improve documentation
  • Report issues
  • Suggest improvements

Please see our Contributing Guide for detailed instructions.

Development Quick Start

# Clone repository
git clone <repository-url>
cd latvia_osm_project

# Setup development environment
python -m venv venv
source venv/bin/activate  # Linux/macOS
# or
.\venv\Scripts\Activate.ps1  # Windows

# Install dependencies
pip install -r requirements.txt

# Start development server
python app.py

See Development Guide for more details.

πŸ“‹ Requirements

  • Python: 3.8 or higher
  • RAM: 2GB minimum (4GB+ recommended for full OSM processing)
  • Disk Space: 1GB for installation + dependencies
  • Operating System: Windows, macOS, or Linux
  • Browser: Any modern browser (Chrome, Firefox, Safari, Edge)

πŸ“¦ Installation Methods

1. Automated Setup (Recommended)

# Windows
.\setup.ps1
.\run.ps1

2. Manual Setup

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python app.py

3. Docker (Coming Soon)

docker build -t latvia-osm-check .
docker run -p 5000:5000 latvia-osm-check

See Installation Guide for detailed setup instructions.

πŸ“Š Data Sources

  • OpenStreetMap: OSM data extract for Latvia (quarterly updates)
  • Official Statistics: Government datasets (2024)
  • Municipality Boundaries: Official LAU1/LAU2 boundaries
  • Supporting Data: Roads, forests, and library records

πŸ“ˆ Statistics & Results

Coverage Summary

  • Total Features Analyzed: 42 (36 municipalities + 6 cities)
  • Features with Complete Data: 39
  • Average Completeness: 249.6% (very comprehensive)
  • Best Mapped Area: Olaine (645.6%)
  • Areas Over 100%: 35 (indicating comprehensive OSM coverage)

Feature Analysis

  • Roads: Complete coverage for 36 municipalities
  • Forests: Full national coverage
  • Libraries: Complete geographic distribution

πŸ” Analysis Capabilities

  • Compare multiple municipalities simultaneously
  • Calculate completeness percentages
  • Generate statistical reports
  • Export data in multiple formats
  • Interactive visualization and exploration
  • Historical data tracking (when available)

πŸ› Reporting Issues

Found a bug? Have a suggestion? Please open an issue on GitHub:

πŸ“š Additional Resources

πŸ“„ License

This project is licensed under the MIT License - see LICENSE file for details.

License Summary

  • βœ… Commercial use permitted
  • βœ… Modification permitted
  • βœ… Distribution permitted
  • βœ… Private use permitted
  • ⚠️ Include license and copyright notice
  • ⚠️ No warranty provided

πŸ‘₯ Contributors

See Contributors for a list of people who have contributed to this project.

Special Thanks

  • OpenStreetMap Community - For the incredible OSM dataset
  • GeoPandas Team - For excellent geospatial tools
  • Flask Team - For lightweight web framework
  • Leaflet.js Community - For interactive mapping library

πŸ“ž Support

πŸ—ΊοΈ Project Roadmap

  • βœ… Core road analysis functionality
  • βœ… Forest coverage analysis
  • βœ… Library location mapping
  • βœ… Interactive web interface
  • βœ… REST API
  • βœ… Comprehensive documentation
  • πŸ”„ Docker containerization
  • πŸ”„ Advanced filtering options
  • πŸ”„ Historical data tracking
  • πŸ”„ Data export enhancements

πŸ“ž Contact

For questions or inquiries about the project:

  • πŸ“§ Email: [project contact]
  • πŸ™ GitHub: [project repository]
  • 🌐 Website: [project website]

Last Updated: January 28, 2026

Status: βœ… Active and Maintained

Version: 1.0.0

See Changelog for version history and release notes.