Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes the GPS latitude and longitude values so that they now take int…

…o account the N/E/S/W references
  • Loading branch information...
commit 1911eff333f7498b8a8de22c3d27e413889d8572 1 parent 1d0a2a0
@arnaud arnaud authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/jpeg.rb
View
8 lib/jpeg.rb
@@ -61,7 +61,9 @@ 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
@@ -69,7 +71,9 @@ 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
Please sign in to comment.
Something went wrong with that request. Please try again.