Class: Map::KmlOffsetService
- Inherits:
-
Object
- Object
- Map::KmlOffsetService
- Defined in:
- lib/map/kml_offset_service.rb
Constant Summary collapse
- MINIMUM_POINTS =
3
Instance Attribute Summary collapse
-
#kml ⇒ Object
readonly
Returns the value of attribute kml.
Instance Method Summary collapse
- #call(offset) ⇒ Object
-
#initialize(kml) ⇒ KmlOffsetService
constructor
A new instance of KmlOffsetService.
Constructor Details
#initialize(kml) ⇒ KmlOffsetService
8 9 10 |
# File 'lib/map/kml_offset_service.rb', line 8 def initialize(kml) @kml = kml end |
Instance Attribute Details
#kml ⇒ Object (readonly)
Returns the value of attribute kml.
6 7 8 |
# File 'lib/map/kml_offset_service.rb', line 6 def kml @kml end |
Instance Method Details
#call(offset) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/map/kml_offset_service.rb', line 12 def call(offset) polygons = coordinates.flat_map do |point| call_python(point.map(&:reverse), offset) if point.length > MINIMUM_POINTS end.compact generate_kml(polygons) end |