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.
28 29 30 |
# File 'lib/neo4j/spatial/osm.rb', line 28 def initialize(node) @node = node end |
Instance Method Details
#first_point ⇒ Object
31 32 33 |
# File 'lib/neo4j/spatial/osm.rb', line 31 def first_point first_point_proxy.outgoing(:NODE).first end |
#first_point_proxy ⇒ Object
37 38 39 |
# File 'lib/neo4j/spatial/osm.rb', line 37 def first_point_proxy @node.outgoing(:FIRST_NODE).first end |
#last_point ⇒ Object
34 35 36 |
# File 'lib/neo4j/spatial/osm.rb', line 34 def last_point last_point_proxy.outgoing(:NODE).first end |
#last_point_proxy ⇒ Object
40 41 42 |
# File 'lib/neo4j/spatial/osm.rb', line 40 def last_point_proxy @node.outgoing(:LAST_NODE).first end |
#points ⇒ Object
43 44 45 46 |
# File 'lib/neo4j/spatial/osm.rb', line 43 def points @node.methods.grep(/traver/).join(', ') first_point_proxy.outgoing(:NEXT).depth(100000).map{|n| n.outgoing(:NODE).first} end |
#to_s ⇒ Object
47 48 49 |
# File 'lib/neo4j/spatial/osm.rb', line 47 def to_s @node['name'] || @node.to_s end |