Skip to content

optimistices-me/MediaGPS2Map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MediaGPS2Map 🌍📸

Python Flask Leaflet

An interactive heatmap tool to visualize your photo and video geolocation data, supporting large datasets and high-performance rendering.

Translation

中文文档:README_zh.md

Key Features

✅ Incremental updates with --add-data option ✅ Supports multiple media formats: HEIC/HEIF, JPG, PNG, MP4, MOV, and other mainstream photo and video formats
✅ Intelligent GPS data parsing (photo + video location)
✅ AMap API address parsing (automatic coordinate correction)
✅ Dynamic heatmap rendering (supports testing with 100,000+ data points)
✅ Responsive sidebar statistics panel
✅ Customizable heatmap style adjustment
✅ Spatiotemporal filtering (filter by time and map area)
✅ Efficient mechanical hard drive storage optimization

Quick Start

Prerequisites

Installation Steps

  1. Clone the repository:
git clone https://github.com/optimistices-me/MediaGPS2Map.git
cd MediaGPS2Map
  1. Install dependencies:
pip install flask requests
  1. Configure config.json:
{
    "AMAP_API_KEY": "Your AMap API key",
    "directories": [
        "Directory 1",
        "Directory 2"
    ],
    "batch_size": 200
}

Running the Program

  1. Initialize the database (first-time run):
python app_hdd.py
  1. Add new media files (incremental update):
python app_hdd.py --add-data "newDirectory"
  1. Start the service (for subsequent runs, use --skip-db to skip database initialization):
python app_hdd.py --skip-db
  1. Access the webpage:

Open your browser and go to http://localhost:5000

User Guide

  1. Heatmap Interaction
  • Drag the timeline to filter the date range
  • Zoom the map to view heat distribution at different levels
  • Click on a hotspot to view detailed media file information
  1. Sidebar Features
  • Real-time statistics of the data in the current view
  • Display typical geographic location distribution
  • Adjust heatmap parameters (radius/blurriness/opacity)
  1. Performance Optimization
  • When using mechanical hard drives, it is recommended to set batch_size=200-1000
  • Zoom to the appropriate level to automatically aggregate data points
  • Use WAL mode to enhance database concurrency performance

Tech Stack

  • Backend: Python + Flask + SQLite
  • Frontend: Leaflet + Leaflet.heat
  • Geoservices: AMap API
  • Metadata Parsing: ExifTool

Configuration Parameters

Parameter Default Value Description
batch_size 500 File processing batch size (recommended 200-500 for mechanical hard drives)
AMAP_API_KEY Required AMap Web Service API Key
directories Required List of media file storage paths

Notes

❗ Do not expose the API key in config.json

❗ Processing a large number of files for the first time may take a long time (recommended to run in the background)

❗ Windows systems require ExifTool to be installed separately and added to the PATH

License

MIT License © 2025 Optimistices-Me

About

An interactive heatmap tool to visualize your photo and video geolocation data, supporting large datasets and high-performance rendering.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors