Class: GeoRuby::SimpleFeatures::MultiLineString::PointLocator
- Inherits:
-
Object
- Object
- GeoRuby::SimpleFeatures::MultiLineString::PointLocator
- Defined in:
- lib/georuby-ext/georuby/locators.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #distance_from_line ⇒ Object
- #distance_on_line ⇒ Object
-
#initialize(target, line, index) ⇒ PointLocator
constructor
A new instance of PointLocator.
- #location ⇒ Object
Constructor Details
#initialize(target, line, index) ⇒ PointLocator
Returns a new instance of PointLocator.
33 34 35 36 37 |
# File 'lib/georuby-ext/georuby/locators.rb', line 33 def initialize(target, line, index) @target = target @line = line @index = index end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
31 32 33 |
# File 'lib/georuby-ext/georuby/locators.rb', line 31 def index @index end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
31 32 33 |
# File 'lib/georuby-ext/georuby/locators.rb', line 31 def line @line end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
31 32 33 |
# File 'lib/georuby-ext/georuby/locators.rb', line 31 def target @target end |
Instance Method Details
#distance_from_line ⇒ Object
47 48 49 |
# File 'lib/georuby-ext/georuby/locators.rb', line 47 def distance_from_line line.distance_from_line(target) end |
#distance_on_line ⇒ Object
43 44 45 |
# File 'lib/georuby-ext/georuby/locators.rb', line 43 def distance_on_line line.distance_on_line(target) end |
#location ⇒ Object
39 40 41 |
# File 'lib/georuby-ext/georuby/locators.rb', line 39 def location line.locate_point(target) end |