Class: GeographicItem::Polygon

Inherits:
GeographicItem
  • Object
show all
Defined in:
app/models/geographic_item/polygon.rb

Overview

Polygon definition…

Constant Summary collapse

SHAPE_COLUMN =
:polygon

Instance Method Summary collapse

Instance Method Details

#keystone_error_boxObject



22
23
24
# File 'app/models/geographic_item/polygon.rb', line 22

def keystone_error_box
  geo_object
end

#rendering_hashHash

Returns:

  • (Hash)


18
19
20
# File 'app/models/geographic_item/polygon.rb', line 18

def rendering_hash
  polygon_to_hash(self.polygon)
end

#st_start_pointRGeo::Point

Returns first point in the polygon.

Returns:

  • (RGeo::Point)

    first point in the polygon



13
14
15
# File 'app/models/geographic_item/polygon.rb', line 13

def st_start_point
  geo_object.exterior_ring.point_n(0)
end

#to_aArray

Returns arrays of points.

Returns:

  • (Array)

    arrays of points



8
9
10
# File 'app/models/geographic_item/polygon.rb', line 8

def to_a
  polygon_to_a(self.polygon)
end