Class: ActiveRoad::OsmPbfImporter::Node
- Inherits:
-
Object
- Object
- ActiveRoad::OsmPbfImporter::Node
- Defined in:
- app/models/active_road/osm_pbf_importer.rb
Instance Attribute Summary collapse
-
#addr_housenumber ⇒ Object
Returns the value of attribute addr_housenumber.
-
#end_of_way ⇒ Object
Returns the value of attribute end_of_way.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lat ⇒ Object
Returns the value of attribute lat.
-
#lon ⇒ Object
Returns the value of attribute lon.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#ways ⇒ Object
Returns the value of attribute ways.
Instance Method Summary collapse
- #add_way(id) ⇒ Object
-
#initialize(id, lon, lat, addr_housenumber = "", ways = [], end_of_way = false, tags = {}) ⇒ Node
constructor
A new instance of Node.
- #marshal_dump ⇒ Object
- #marshal_load(array) ⇒ Object
- #used? ⇒ Boolean
Constructor Details
#initialize(id, lon, lat, addr_housenumber = "", ways = [], end_of_way = false, tags = {}) ⇒ Node
Returns a new instance of Node.
233 234 235 236 237 238 239 240 241 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 233 def initialize(id, lon, lat, addr_housenumber = "", ways = [], end_of_way = false, = {} ) @id = id @lon = lon @lat = lat @addr_housenumber = addr_housenumber @ways = ways @end_of_way = end_of_way = end |
Instance Attribute Details
#addr_housenumber ⇒ Object
Returns the value of attribute addr_housenumber.
231 232 233 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 231 def addr_housenumber @addr_housenumber end |
#end_of_way ⇒ Object
Returns the value of attribute end_of_way.
231 232 233 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 231 def end_of_way @end_of_way end |
#id ⇒ Object
Returns the value of attribute id.
231 232 233 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 231 def id @id end |
#lat ⇒ Object
Returns the value of attribute lat.
231 232 233 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 231 def lat @lat end |
#lon ⇒ Object
Returns the value of attribute lon.
231 232 233 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 231 def lon @lon end |
#tags ⇒ Object
Returns the value of attribute tags.
231 232 233 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 231 def end |
#ways ⇒ Object
Returns the value of attribute ways.
231 232 233 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 231 def ways @ways end |
Instance Method Details
#add_way(id) ⇒ Object
243 244 245 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 243 def add_way(id) @ways << id end |
#marshal_dump ⇒ Object
247 248 249 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 247 def marshal_dump [@id, @lon, @lat, @addr_housenumber, @ways, @end_of_way, ] end |
#marshal_load(array) ⇒ Object
251 252 253 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 251 def marshal_load array @id, @lon, @lat, @addr_housenumber, @ways, @end_of_way, = array end |
#used? ⇒ Boolean
255 256 257 |
# File 'app/models/active_road/osm_pbf_importer.rb', line 255 def used? ( ways.present? && ways.size > 1 ) || end_of_way end |