Skip to content

ogoodwin505/mapchallenge2025

Repository files navigation

UK Longest Unobstructed View

Finding the longest unobstructed great circle view from the UK coastline to any landmass on Earth.

Scripts

Route Finding

find_longest_view_systematic.py - Main analysis script

  • Systematically scans the entire UK coastline
  • Uses two-phase ray-casting for efficiency
  • Configurable spacing and check intervals
  • Outputs timestamped JSON results
# Run with custom parameters
python find_longest_view_systematic.py --spacing 0.1 --check-interval 250 --threshold 7000

# Or use the logging wrapper
./run_with_log.sh --spacing 0.1 --check-interval 250 --threshold 7000

Parameters:

  • --spacing: Coastline sampling interval in km (default: 100.0)
  • --check-interval: Fine-grain checking interval in meters (default: 50)
  • --threshold: Minimum distance threshold in km (default: 5000.0)

Visualizations

cartopy_viz.py - High-quality publication map

  • Robinson projection with Natural Earth raster relief
  • Inset showing start point detail
  • Info box with coordinates and distance
  • 300 DPI output suitable for printing
python cartopy_viz.py

check_route_viz.py - Interactive verification map

  • Folium-based interactive HTML map
  • Shows top 10 longest views with markers
  • Great circle routes for each view
  • Click markers for detailed information
python check_route_viz.py

run_with_log.sh - Wrapper for timestamped logging

  • Automatically adds timestamps to each output line
  • Saves to dated log files
  • Useful for monitoring long-running analyses

Installation

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

How It Works

  1. Load Data: Natural Earth 10m coastline and country polygons
  2. Sample Coastline: Generate points at specified intervals along UK coast
  3. Calculate Directions: Determine perpendicular outward direction from each point
  4. Two-Phase Checking:
    • Phase 1: Coarse check every 100km to quickly filter paths < threshold
    • Phase 2: Fine-grain check at specified intervals for promising paths
  5. Find Longest: Identify the maximum unobstructed distance

Output Files

Results are saved with descriptive filenames including parameters:

longest_view_result_YYYYMMDD_HHMMSS_spacingXkm_checkYm_threshZkm.json

Each result file contains:

  • Longest view details (coordinates, distance, azimuth, destination)
  • Top 10 views for reference
  • Metadata (parameters, processing time, cores used)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors