Class: Neo4j::Spatial::OSMWay
- Inherits:
-
Object
- Object
- Neo4j::Spatial::OSMWay
- Defined in:
- lib/neo4j/spatial/osm.rb
Instance Method Summary collapse
- #first_point ⇒ Object
- #first_point_proxy ⇒ Object
-
#initialize(node) ⇒ OSMWay
constructor
A new instance of OSMWay.
- #last_point ⇒ Object
- #last_point_proxy ⇒ Object
- #points ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(node) ⇒ OSMWay
Returns a new instance of OSMWay.
27 28 29 |
# File 'lib/neo4j/spatial/osm.rb', line 27 def initialize(node) @node = node end |
Instance Method Details
#first_point ⇒ Object
30 31 32 |
# File 'lib/neo4j/spatial/osm.rb', line 30 def first_point first_point_proxy.outgoing(:NODE).first end |
#first_point_proxy ⇒ Object
36 37 38 |
# File 'lib/neo4j/spatial/osm.rb', line 36 def first_point_proxy @node.outgoing(:FIRST_NODE).first end |
#last_point ⇒ Object
33 34 35 |
# File 'lib/neo4j/spatial/osm.rb', line 33 def last_point last_point_proxy.outgoing(:NODE).first end |
#last_point_proxy ⇒ Object
39 40 41 |
# File 'lib/neo4j/spatial/osm.rb', line 39 def last_point_proxy @node.outgoing(:LAST_NODE).first end |
#points ⇒ Object
42 43 44 45 |
# File 'lib/neo4j/spatial/osm.rb', line 42 def points @node.methods.grep(/traver/).join(', ') first_point_proxy.outgoing(:NEXT).depth(100000).map{|n| n.outgoing(:NODE).first} end |
#to_s ⇒ Object
46 47 48 |
# File 'lib/neo4j/spatial/osm.rb', line 46 def to_s @node['name'] || @node.to_s end |