Coder Social home page Coder Social logo

test_picture_location's Introduction

test_picture_location

This is a simple python script that uses exiftool to read the GPS location from an image file and test if it is near a given location within a given radius.

Prerequisites

  • Python 2.7
  • exiftool available on the path.

Usage

$ ./test_picture_location.py <image_file_path> <latitude> <longitude> <radius>

Where...

  • image_file_path -- Path to the file which location you want to test.
  • latitude -- Latitude of the target location in decimal format (e.g. -37.1234567)
  • longitude -- Longitude of the target location in decimal format (e.g. 145.7654321)
  • radius -- The radius from the target location. If the image file was taken within this radius, the file is considered a match.

If the file matches, it outputs the path of the file to stdout, and the script exits with a 0 exit code.

If the file does not match, nothing is output to stdout, and the script exits with a non-zero exit code.

Example #1

The following command tests if IMG_1234.JPG was taken within one kilometer of the Eureka Tower in Melbourne Australia.

$ ./test_picture_location.py ~/Picture/IMG_1234.JPG -37.821638 144.9645348 1

Example #2

The following command finds all the JPEG pictures in the Pictures folder that were taken within one kilometer of the Eureka Tower in Melbourne Australia.

find ~/Pictures -iname '*.jpg' -exec ./test_picture_location.py {} -37.821638 144.9645348 1 \;

test_picture_location's People

Contributors

karlchu avatar

Watchers

 avatar

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.