Method: MapWKT::Geometry::Polygon#wkt

Defined in:
lib/mapwkt/wkt/polygon.rb

#wktObject

Returns this Polygon’s WKT representation, with latitudes and longitudes rounded to 7 decimal places.



39
40
41
# File 'lib/mapwkt/wkt/polygon.rb', line 39

def wkt
  "POLYGON((#{[*@perimeter.points, @perimeter.points.first].map {|p| "#{p.longitude_f} #{p.latitude_f}" }.join(", ")})#{@lacunae.map {|lacuna| ", (#{[*lacuna.points, lacuna.points.first].map {|p| "#{p.longitude_f} #{p.latitude_f}" }.join(", ")})" }.join })"
end