Class: ActiveRoad::OsmPbfImporterLevelDb::SimpleWay
- Inherits:
-
Object
- Object
- ActiveRoad::OsmPbfImporterLevelDb::SimpleWay
- Includes:
- Comparable
- Defined in:
- app/models/active_road/osm_pbf_importer_level_db.rb
Instance Attribute Summary collapse
-
#arrival_objectid ⇒ Object
Returns the value of attribute arrival_objectid.
-
#boundary_id ⇒ Object
Returns the value of attribute boundary_id.
-
#departure_objectid ⇒ Object
Returns the value of attribute departure_objectid.
-
#geometry ⇒ Object
Returns the value of attribute geometry.
-
#next ⇒ Object
Returns the value of attribute next.
-
#old_arrival_geometry ⇒ Object
Returns the value of attribute old_arrival_geometry.
-
#old_arrival_objectid ⇒ Object
Returns the value of attribute old_arrival_objectid.
-
#old_departure_geometry ⇒ Object
Returns the value of attribute old_departure_geometry.
-
#old_departure_objectid ⇒ Object
Returns the value of attribute old_departure_objectid.
-
#old_physical_road_geometry ⇒ Object
Returns the value of attribute old_physical_road_geometry.
-
#old_physical_road_id ⇒ Object
Returns the value of attribute old_physical_road_id.
-
#old_physical_road_objectid ⇒ Object
Returns the value of attribute old_physical_road_objectid.
-
#old_physical_road_tags ⇒ Object
Returns the value of attribute old_physical_road_tags.
-
#previous ⇒ Object
Returns the value of attribute previous.
Instance Method Summary collapse
- #<=>(another) ⇒ Object
- #arrival ⇒ Object
- #default_arrival_objectid ⇒ Object
- #default_departure_objectid ⇒ Object
- #departure ⇒ Object
-
#initialize(boundary_id, old_physical_road_id, old_physical_road_objectid, old_physical_road_tags, old_physical_road_geometry, old_departure_objectid, old_departure_geometry, old_arrival_objectid, old_arrival_geometry, geometry) ⇒ SimpleWay
constructor
A new instance of SimpleWay.
- #old_physical_road_tags_hash ⇒ Object
Constructor Details
#initialize(boundary_id, old_physical_road_id, old_physical_road_objectid, old_physical_road_tags, old_physical_road_geometry, old_departure_objectid, old_departure_geometry, old_arrival_objectid, old_arrival_geometry, geometry) ⇒ SimpleWay
Returns a new instance of SimpleWay.
602 603 604 605 606 607 608 609 610 611 612 613 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 602 def initialize(boundary_id, old_physical_road_id, old_physical_road_objectid, , old_physical_road_geometry, old_departure_objectid, old_departure_geometry, old_arrival_objectid, old_arrival_geometry, geometry) @boundary_id = boundary_id @old_physical_road_id = old_physical_road_id @old_physical_road_objectid = old_physical_road_objectid @old_physical_road_tags = || "" @old_physical_road_geometry = old_physical_road_geometry @old_departure_objectid = old_departure_objectid @old_departure_geometry = old_departure_geometry @old_arrival_objectid = old_arrival_objectid @old_arrival_geometry = old_arrival_geometry @geometry = geometry end |
Instance Attribute Details
#arrival_objectid ⇒ Object
Returns the value of attribute arrival_objectid.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def arrival_objectid @arrival_objectid end |
#boundary_id ⇒ Object
Returns the value of attribute boundary_id.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def boundary_id @boundary_id end |
#departure_objectid ⇒ Object
Returns the value of attribute departure_objectid.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def departure_objectid @departure_objectid end |
#geometry ⇒ Object
Returns the value of attribute geometry.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def geometry @geometry end |
#next ⇒ Object
Returns the value of attribute next.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def next @next end |
#old_arrival_geometry ⇒ Object
Returns the value of attribute old_arrival_geometry.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def old_arrival_geometry @old_arrival_geometry end |
#old_arrival_objectid ⇒ Object
Returns the value of attribute old_arrival_objectid.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def old_arrival_objectid @old_arrival_objectid end |
#old_departure_geometry ⇒ Object
Returns the value of attribute old_departure_geometry.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def old_departure_geometry @old_departure_geometry end |
#old_departure_objectid ⇒ Object
Returns the value of attribute old_departure_objectid.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def old_departure_objectid @old_departure_objectid end |
#old_physical_road_geometry ⇒ Object
Returns the value of attribute old_physical_road_geometry.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def old_physical_road_geometry @old_physical_road_geometry end |
#old_physical_road_id ⇒ Object
Returns the value of attribute old_physical_road_id.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def old_physical_road_id @old_physical_road_id end |
#old_physical_road_objectid ⇒ Object
Returns the value of attribute old_physical_road_objectid.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def old_physical_road_objectid @old_physical_road_objectid end |
#old_physical_road_tags ⇒ Object
Returns the value of attribute old_physical_road_tags.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def @old_physical_road_tags end |
#previous ⇒ Object
Returns the value of attribute previous.
600 601 602 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 600 def previous @previous end |
Instance Method Details
#<=>(another) ⇒ Object
642 643 644 645 646 647 648 649 650 651 652 653 654 655 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 642 def <=>(another) # puts "self : #{self.departure.inspect}, #{self.arrival.inspect}" # puts "another : #{another.departure.inspect}, #{another.arrival.inspect}" # puts old_physical_road_geometry.points.inspect # puts old_physical_road_geometry.points.index(another.arrival).inspect # puts old_physical_road_geometry.points.index(self.departure).inspect if self.departure == another.arrival || old_physical_road_geometry.points.index(another.arrival) < old_physical_road_geometry.points.index(self.departure) 1 elsif self.arrival == another.departure || old_physical_road_geometry.points.index(self.arrival) < old_physical_road_geometry.points.index(another.departure) -1 else nil end end |
#arrival ⇒ Object
630 631 632 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 630 def arrival geometry.points.last if geometry end |
#default_arrival_objectid ⇒ Object
638 639 640 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 638 def default_arrival_objectid "#{old_departure_objectid}-#{old_arrival_objectid}" end |
#default_departure_objectid ⇒ Object
634 635 636 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 634 def default_departure_objectid "#{old_departure_objectid}-#{old_arrival_objectid}" end |
#departure ⇒ Object
625 626 627 628 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 625 def departure #puts "geometry class #{geometry.class}, value #{geometry.inspect}" geometry.points.first if geometry end |
#old_physical_road_tags_hash ⇒ Object
615 616 617 618 619 620 621 622 623 |
# File 'app/models/active_road/osm_pbf_importer_level_db.rb', line 615 def #Fix tags build from string = {}.tap do || .split(',').each do |pair| key, value = pair.split("=>") [key.gsub(/\W/, "")] = value.gsub(/\W/, "") end end end |