Class: GeographicItem::Point
- Inherits:
-
GeographicItem
- Object
- GeographicItem
- GeographicItem::Point
- Defined in:
- app/models/geographic_item/point.rb
Overview
A geographic point.
Constant Summary collapse
- SHAPE_COLUMN =
:point
Instance Method Summary collapse
-
#check_point_limits ⇒ Boolean
protected
true iff point.x is between -180.0 and +180.0.
- #rendering_hash ⇒ Hash
-
#st_start_point ⇒ RGeo::Point
The first POINT of self.
-
#to_a ⇒ Array
A point.
Instance Method Details
#check_point_limits ⇒ Boolean (protected)
true iff point.x is between -180.0 and +180.0
27 28 29 30 31 |
# File 'app/models/geographic_item/point.rb', line 27 def check_point_limits unless point.nil? errors.add(:point_limit, 'Longitude exceeds limits: 180.0 to -180.0.') if point.x > 180.0 || point.x < -180.0 end end |
#rendering_hash ⇒ Hash
19 20 21 |
# File 'app/models/geographic_item/point.rb', line 19 def rendering_hash point_to_hash(self.point) end |
#st_start_point ⇒ RGeo::Point
Returns the first POINT of self.
14 15 16 |
# File 'app/models/geographic_item/point.rb', line 14 def st_start_point self.geo_object end |
#to_a ⇒ Array
Returns a point.
9 10 11 |
# File 'app/models/geographic_item/point.rb', line 9 def to_a point_to_a(self.point) end |