Class: CartoJson::Polygon

Inherits:
LineString show all
Defined in:
lib/carto_json/polygon.rb

Instance Attribute Summary

Attributes inherited from LineString

#points

Instance Method Summary collapse

Methods inherited from LineString

#initialize, #to_hash

Methods included from Shape

included, #initialize, #to_hash, #to_json, #to_pretty_json, #to_s, #type

Constructor Details

This class inherits a constructor from CartoJson::LineString

Instance Method Details

#to_wktObject



5
6
7
# File 'lib/carto_json/polygon.rb', line 5

def to_wkt
  "#{type.to_s.upcase} ((#{@points.dup.push(@points.first).collect {|p| "#{p.send(LNG)} #{p.send(LAT)}"}.join(', ')}))"
end