Class: CloudMade::MultiLine

Inherits:
Geometry show all
Defined in:
lib/cloudmade/geometry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Geometry

parse

Constructor Details

#initialize(coords) ⇒ MultiLine

Returns a new instance of MultiLine.



101
102
103
# File 'lib/cloudmade/geometry.rb', line 101

def initialize(coords)
  @lines = coords.map { |line_coords| Line.new(line_coords) }
end

Instance Attribute Details

#linesObject

Returns the value of attribute lines.



99
100
101
# File 'lib/cloudmade/geometry.rb', line 99

def lines
  @lines
end

Instance Method Details

#to_sObject



105
106
107
# File 'lib/cloudmade/geometry.rb', line 105

def to_s
  "MultiLine(#{@lines.join(',')})"
end

#to_wktObject



109
110
111
# File 'lib/cloudmade/geometry.rb', line 109

def to_wkt
  "MULTILINESTRING (#{wkt_helper})"
end

#wkt_helperObject



113
114
115
# File 'lib/cloudmade/geometry.rb', line 113

def wkt_helper
  @lines.map(&:wkt_helper).join(', ')
end