]> git.openstreetmap.org Git - rails.git/blobdiff - lib/osm.rb
gpx insert now works
[rails.git] / lib / osm.rb
index 41c5874599ef957a8422834459ff21849b2e3d2a..af9608132e8f293aa971dbbb8317cbfa93aef99a 100644 (file)
@@ -14,11 +14,13 @@ module OSM
 
   class GPXImporter
     attr_reader :possible_points
+    attr_reader :actual_points
     attr_reader :tracksegs
 
     def initialize(filename)
       @filename = filename
       @possible_points = 0
+      @actual_points = 0
       @tracksegs = 0
     end
 
@@ -61,6 +63,7 @@ module OSM
         if gotlatlon && gotdate
           ele = '0' unless gotele
           if lat < 90 && lat > -90 && lon > -180 && lon < 180
+            @actual_points += 1
             yield Hash['latitude' => lat,'longitude' => lon,'timestamp' => date,'altitude' => ele,'segment' => @tracksegs]
           end
         end