Class: GeoRuby::SimpleFeatures::MultiLineString::PointLocator

Inherits:
Object
  • Object
show all
Defined in:
lib/georuby-ext/georuby/locators.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#indexObject (readonly)

Returns the value of attribute index.



31
32
33
# File 'lib/georuby-ext/georuby/locators.rb', line 31

def index
  @index
end

#lineObject (readonly)

Returns the value of attribute line.



31
32
33
# File 'lib/georuby-ext/georuby/locators.rb', line 31

def line
  @line
end

#targetObject (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_lineObject



47
48
49
# File 'lib/georuby-ext/georuby/locators.rb', line 47

def distance_from_line
  line.distance_from_line(target)
end

#distance_on_lineObject



43
44
45
# File 'lib/georuby-ext/georuby/locators.rb', line 43

def distance_on_line
  line.distance_on_line(target)
end

#locationObject



39
40
41
# File 'lib/georuby-ext/georuby/locators.rb', line 39

def location
  line.locate_point(target)
end