Giter Site home page Giter Site logo

ptanov / photos-to-map Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 7.61 MB

This simple script extracts GPS coordinates from all images in a directory and places them on a map.

License: Apache License 2.0

Dockerfile 8.99% Shell 91.01%
gps gpx kml photos coordinates map

photos-to-map's Introduction

photos-to-map

This simple script extracts GPS coordinates from all images in a directory. Then it creates KML file with coordinates of all images. There is a link to open the image in Google Photos (if you have a copy of the images in Google Photos) - all photos from previous and next day, all photos from the day of the photo and exact photo are the three options. Then you can always open KML files in any GPS software, e.g. Google Earth (web/desktop/Android/iPhone), GpsPrune, etc.

When using Google Earth you can download different OpenStreet maps layers from Google Earth Map Overlays in order to have hike trails like this: Google Earth + Komoot

There is a docker image here: https://hub.docker.com/r/ptanov/photos-to-map. The source code is available here: https://github.com/ptanov/photos-to-map.

Running the script

Without Docker

  • exiftool is required (you can install it using sudo apt install exiftool)
  • photos-to-map.sh "PATH-TO-IMAGES" > photos-to-map.kml
  • photos in current folder
    • photos-to-map.sh > photos-to-map.kml

With Docker

  • docker is required (you can install it using docker install script)
  • docker run --rm -v "PATH-TO-IMAGES":/data:ro ptanov/photos-to-map > photos-to-map.kml
  • photos in current folder
    • docker run --rm -v "$(pwd)":/data:ro ptanov/photos-to-map > photos-to-map.kml

Screenshots

  • Initial
  • Photos from the day
  • Exact photo
  • Initial
  • Google Earth + Komoot
  • Initial Selected image Exact photo

What if I don't have GPS coordinates

You can download your Location History (if enabled) from Google Takeout. Select only Google Location History and use KML format (instead of JSON). Then you can create a copy of your photos (check the script copy-image-exif.sh) and run this command targeting the COPY of the images (it will set approximately location to the images) exiftool -api GeoMaxIntSecs=18000 -api GeoMaxExtSecs=18000 -overwrite_original -geotag "Location History.kml" "PATH-TO-IMAGES/*" (You can use 240 instead of 18000 to geotag only exact matches, e.g. when you have gpx file: exiftool -api GeoMaxIntSecs=240 -api GeoMaxExtSecs=240 -overwrite_original -geotag "*.gpx" "PATH-TO-IMAGES/*"). For more information check exiftool.

Docker

Performance

It tooks ~ 20 minutes to generate KML files for all my images (from 2005 until now - more than 800 folders) on my 10+ years old i7 laptop with HDD (no SSD).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.