Ruby gem loading GPS position from photo's EXIF informations into (Rails) models.
Created and tested for photos from iPhone and placing it to model.
Simplest - load position data and handle on your own
photo = PhotoGeoloader.new('path/to/photo.jpg')
p photo.position[:latitude]
p photo.position[:longitude]
p photo.position[:altitude]
Rails model example
# attributes: photo (string, carrierwave uploader), latitude (float), longitude (float), altitude (float)
class Photo < ActiveRecord::Base
attr_accessible :photo
mount_uploader :photo, MyPhotoUploader
before_create do
PhotoGeoloader.new(photo.path).place_attributes self
end
end
Released under MIT license