jokiazhang / metadata-extractor

Automatically exported from code.google.com/p/metadata-extractor
0 stars 0 forks source link

Improve support for GPS data with a custom GeoLocation class #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
GpsDirectory should have a new method that returns the latitude/longitude as a 
new object type that allows conversion between different representations 
(decimal, DMS, etc.)

Someone posted something similar here:

http://forums.eye.fi/viewtopic.php?t=2623&p=11475

Original issue reported on code.google.com by drewnoakes on 2 May 2011 at 8:09

GoogleCodeExporter commented 9 years ago
At the very least, it would be handy to have a way to convert the lat/lon 
Rational[] into a float, even if it was a hidden/undocumented method until 
there is time to build this new GeoLocation class.

Original comment by ibex...@gmail.com on 1 May 2012 at 5:57

GoogleCodeExporter commented 9 years ago
Code for this has been committed and will be available in the next release.

To see it in action, check out the new sample application:

http://code.google.com/p/metadata-extractor/source/browse/Samples/com/drew/metad
ata/GeoTagMapBuilder.java

In short, you can write code like this:

{{{
GeoLocation geoLocation = gpsDirectory.getGeoLocation();
if (geoLocation == null || geoLocation.isZero())
{
    // geoLocation.Latitude / geoLocation.Longitude
} 
}}}

Original comment by drewnoakes on 21 May 2012 at 2:07