Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VFR Map Processor

This repository contains a Python script to process FAA Visual Flight Rules (VFR) sectional chart ZIP files into MBTiles format for web mapping or GIS applications. The script automates unzipping, cropping, reprojection, and tile generation, producing compact MBTiles files (~20MB) with transparent no-data areas for seamless stitching in tools like QGIS.

Stitched MBTiles Stitched MBTiles

Features

  • Input: FAA VFR chart ZIPs or unzipped folders from FAA Digital Products.
  • Output: MBTiles files in EPSG:3857, zoom levels 10-13, WebP compression.
  • Automation: Handles multiple charts, skips processed folders, resumes from intermediates.
  • Transparency: Chart borders/legends are transformed to transparent for clean map overlays.
  • Logging: Detailed progress in vfr_processing.log.

Prerequisites

  • Operating System: Windows, macOS, or Linux.
  • Python: 3.8 or higher.
  • Conda: Miniconda or Anaconda.
  • Git: For cloning the repository.
  • Disk Space: ~100-200MB per chart (includes intermediates).

Setup

1. Clone the Repository

Clone this repository to your local machine:

git clone https://github.com/howl0893/vfr-map-processor.git
cd vfr-map-processor

2. Create a Conda Environment

Create and activate a Conda environment named vfr:

conda create -n vfr python=3.8
conda activate vfr

3. Install Required Packages

Install required packages using conda and pip. The script depends on GDAL with WebP support, along with other libraries.

conda install -c conda-forge gdal numpy scikit-image scipy matplotlib
pip install rasterio

Verify GDAL supports WebP (required for MBTiles):

gdalinfo --formats | grep -i webp

4. Download FAA VFR Charts

  1. Visit the FAA VFR Charts page.
  2. Scroll to the "Sectional Charts" section.
  3. Download ZIP files (e.g., Los_Angeles.zip, Las_Vegas.zip) by clicking the links.
  4. Place the ZIPs in the media/ directory (create it if needed):
mkdir media
mv ~/Downloads/Los_Angeles.zip media/
mv ~/Downloads/Las_Vegas.zip media/

Alternatively, unzip the files manually and place the folders (e.g., media/Las_Vegas/) in media/.

Usage

1. Run the script to process all ZIPs or folders in media/:

conda activate vfr
python vfr_processing.py

The script will:

Unzip ZIP files (skips if already unzipped). Find .tif files (handles renamed TIFFs). Process each chart into MBTiles, resuming from existing intermediates if available. Log progress to vfr_processing.log.

Processing Pipeline

The script processes each chart in three steps, preserving intermediate files for debugging or reuse.

original tiff

1. Cropping

Input: Original TIFF (e.g., Las Vegas SEC.tif).
Process: Crops the map to a polygon around the chart area, removing white borders, and saves as RGBA with transparent no-data areas.
Output: <name>-crop.tif (e.g., las_vegas-crop.tif).

cropped tif

2. Reprojecting

Input: Cropped TIFF.
Process: Reprojects to EPSG:3857 (Web Mercator) for web mapping compatibility, preserving transparency.
Output: <name>-crop-3857.tif (e.g., las_vegas-crop-3857.tif).

reprojected tif

3. MBTiles Conversion

Input: Reprojected TIFF.
Process: Converts to MBTiles with WebP compression (zoom 10-13, quality 20).
Output: <name>.mbtiles (e.g., las_vegas.mbtiles).

mbtile-qgis

About

FAA VFR map processor - crop, reproject, and convert to mbtiles for easy map stitching

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages