Project

geoloclog

0.0
No commit activity in last 3 years
No release in over 3 years
Logs geolocated placenames as well as coordinates in reverse chronological order.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.3.0, ~> 0.3
>= 0.2.2, ~> 0.2
 Project Readme

Introducing the geoloclog gem

require 'geoloclog'
require 'chronic_duration'


# logging is started
gll = GeoLocLog.new labels: 'labels.yaml'
gll.add 55.9432475, -3.1420572

# logging ends

# minutes later logging starts again
gll = GeoLocLog.new 'geoloclog.xml', labels: 'labels.yaml'
gll.add 55.9592332, -3.1375362

# logging ends

# a few minutes later, logging starts once more
gll = GeoLocLog.new labels: 'labels.yaml'
gll.add 55.9432475, -3.1420572


loc = gll.last_location
last_seen = ChronicDuration.output((Time.now - Time.parse(loc.lastseen)).round)  
puts "%s was last seen at %s %s ago" % ['James', 
                                          loc.label || loc.place, last_seen]

#=> "James was last seen at home 1 min 24 secs ago"

file: labels.yaml

---
Duddingston Road West: home
Highriggs Way: Building 1

The geoloclog gem is intended to locate me relative to a place name which can either be a street name or a user-defined name whichs maps to a place name for the sake of privacy.

Notes:

  1. I have used a fake home address in the above example
  2. The coordinates are automatically converted to place names
  3. This gem relies upon the geocoder gem which relies upon the Google API which sometimes may return an error if the service is too busy.

Resources

geoloclog gps location tracking logging