ivebeen 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/ivebeen +0 -4
- data/lib/exif2geojson.rb +3 -2
- metadata +1 -1
data/bin/ivebeen
CHANGED
@@ -5,11 +5,7 @@ require "exif2geojson"
|
|
5
5
|
|
6
6
|
class IveBeenApp < Thor
|
7
7
|
desc "generate", "Extract EXIF from photo and generate geojson file"
|
8
|
-
# method_option :path, :aliases => "-p", :desc => "path of where you're storing your photos", :required => true
|
9
|
-
# method_option :result, :aliases => "-f", :desc => "the result geojson file, default value is places.geojson", :default => "places.geojson"
|
10
8
|
def generate(path, file="places.geojson")
|
11
|
-
# path = options[:path]
|
12
|
-
# file = options[:result] || "places.geojson"
|
13
9
|
info = extract_image_info(path)
|
14
10
|
File.open(file, "w") do |f|
|
15
11
|
f.write(info)
|
data/lib/exif2geojson.rb
CHANGED
@@ -31,7 +31,8 @@ def format_attachment_gps(file)
|
|
31
31
|
{ :type => "Feature",
|
32
32
|
:geometry => geometry,
|
33
33
|
:properties => {
|
34
|
-
:altitude => altitude
|
34
|
+
:altitude => altitude,
|
35
|
+
:datetime => exif.date_time
|
35
36
|
}
|
36
37
|
}
|
37
38
|
end
|
@@ -40,7 +41,7 @@ def extract_image_info(path)
|
|
40
41
|
image_types = "*.jpg"
|
41
42
|
|
42
43
|
info = []
|
43
|
-
Dir.glob("#{path}/#{image_types}") do |jpg|
|
44
|
+
Dir.glob("#{File.expand_path(path)}/#{image_types}", File::FNM_CASEFOLD) do |jpg|
|
44
45
|
begin
|
45
46
|
info << format_attachment_gps(jpg)
|
46
47
|
print "."
|