Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes the GPS latitude and longitude values so that they now take int…
…o account the N/E/S/W references
  • Loading branch information
arnaud committed Jul 19, 2011
1 parent 1d0a2a0 commit 1911eff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/jpeg.rb
Expand Up @@ -61,15 +61,19 @@ def gps_lat
if self.gps_latitude.nil? or self.gps_latitude.length < 2
nil
else
self.gps_latitude[0].to_f+self.gps_latitude[1].to_f/60+self.gps_latitude[2].to_f/3600
value = self.gps_latitude[0].to_f+self.gps_latitude[1].to_f/60+self.gps_latitude[2].to_f/3600
value = -value if self.gps_latitude_ref.to_s == "S"
value
end
end

def gps_lng
if self.gps_longitude.nil? or self.gps_longitude.length < 2
nil
else
self.gps_longitude[0].to_f+self.gps_longitude[1].to_f/60+self.gps_longitude[2].to_f/3600
value = self.gps_longitude[0].to_f+self.gps_longitude[1].to_f/60+self.gps_longitude[2].to_f/3600
value = -value if self.gps_longitude_ref.to_s == "W"
value
end
end

Expand Down

0 comments on commit 1911eff

Please sign in to comment.