diversen/gps-from-exif

Get GPS from exif

1.0.7 2016-07-19 12:05 UTC

This package is auto-updated.

Last update: 2024-12-20 09:18:59 UTC


README

Get GPS from exif

Install:

composer require diversen/gps-from-exif

Usage example:

include_once "vendor/autoload.php";

use \diversen\gps;

// Example file
// $file = "vendor/diversen/gps-from-exif/failure.jpg";
$file = "vendor/diversen/gps-from-exif/example.jpg";

$g = new gps();

// Get GPS position
$gps = $g->getGpsPosition($file);
if (empty($gps)) {
    die('Could not get GPS position' . PHP_EOL);
}

print_r($gps);

// Get a google map
echo $gmap = $g->getGmap($gps['latitude'], $gps['longitude'], 600, 350);