geolocation - Reading Geotag data from image in php -


Do anyone know that there is no way to read geotag data from photos in PHP?

Thanks

As everyone else said, exif_read_data (); Will do To move forward and get all the data, use these arguments:

  exif_read_data ($ img, 0, true); // where $ img is the path to your image   

This function can read the header only with the fights and JPEG and I am pretty sure that only JPEG can be geotagged. I have written a simple PHP script for use in the command line and posted it like this one.

Run the script like this: php exif.php

This resonates an array. See coordinates here:

  [GPS] => Array [GPSLatitudeRef] = & gt; N [GPSLatitude] = & gt; Array [0] = & gt; 30/1 [1] = & gt; 1589/100 [2] = & gt; 0/1 [GPSLongitudeRef] = & gt; W [GPS links] = & gt; Array [0] = & gt; 87/1 [1] = & gt; 360 9/100 [2] = & gt; 0/1 [GPS ultrittraph] => [GPSAltitude] = & gt; 1828 9/454 [GPStreamStamp] = & gt; Array [0] = & gt; 20/1 [1] = & gt; 22/1 [2] = & gt; 2065/1 [GPSImgDirectionRef] = & gt; T [GPSImg direction] = & gt; 34765/689   

There are three values ​​in the arrays of latitude and longitude: for 0 degrees, for 1 minute and for 2 seconds if you have something like "1589/100" So, it's equal to 15.89. So for the GPS logentive array, 360 9/100 is equal to 36.09.

Convert the coordinates from a degree-minute-second form to a decimal form

If the latitude is south, do not forget to make it negative if the longitude is latitude, then make negative. The above figures are Qdnets: 30.26483, -87.6015

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -