Class: CloudMade::Geometry

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

Direct Known Subclasses

BBox, Line, MultiLine, MultiPolygon, Point, Polygon

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(data) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/cloudmade/geometry.rb', line 21

def parse(data)
  return nil if data == nil
  case data['type'].downcase
  when 'point' then return Point.new(data['coordinates'])
  when 'line' then return Line.new(data['coordinates'])
  when 'multilinestring' then return MultiLine.new(data['coordinates'])
  when 'polygon' then return Polygon.new(data['coordinates'])
  when 'multipolygon' then return MultiPolygon.new(data['coordinates'])
  end
end

Instance Method Details

#wkt_helperObject



34
35
36
# File 'lib/cloudmade/geometry.rb', line 34

def wkt_helper
  raise 'Not implemented'
end