SpeciesFileGroup/taxonworks

View on GitHub
app/models/geographic_item/polygon.rb

Summary

Maintainability
A
0 mins
Test Coverage
# Polygon definition...
#
class GeographicItem::Polygon < GeographicItem
  SHAPE_COLUMN = :polygon
  validates_presence_of :polygon

  # @return [Array] arrays of points
  def to_a
    polygon_to_a(self.polygon)
  end

  # @return [RGeo::Point] first point in the polygon
  def st_start_point
    geo_object.exterior_ring.point_n(0)
  end

  # @return [Hash]
  def rendering_hash
    polygon_to_hash(self.polygon)
  end

  def keystone_error_box
    geo_object
  end
end