Class: NSWTopo::GPS
- Inherits:
-
Object
- Object
- NSWTopo::GPS
- Defined in:
- lib/nswtopo/gis/gps.rb,
lib/nswtopo/gis/gps/gpx.rb,
lib/nswtopo/gis/gps/kml.rb
Defined Under Namespace
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path) ⇒ GPS
constructor
A new instance of GPS.
Constructor Details
#initialize(path) ⇒ GPS
Returns a new instance of GPS.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/nswtopo/gis/gps.rb', line 6 def initialize(path) @xml = REXML::Document.new(path.read) case when @xml.elements["/gpx"] then extend GPX when @xml.elements["/kml"] then extend KML else raise "invalid GPX or KML file: #{path}" end rescue SystemCallError raise "couldn't read file: #{path}" end |
Class Method Details
.load(path) ⇒ Object
18 19 20 |
# File 'lib/nswtopo/gis/gps.rb', line 18 def self.load(path) new(path).collection end |