Class: GeographicItem::Polygon

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

Overview

Polygon definition…

Constant Summary

SHAPE_COLUMN =
:polygon

Constants inherited from GeographicItem

ANTI_MERIDIAN, DATA_TYPES, GEOGRAPHY_SQL, GEOMETRY_SQL

Instance Attribute Summary

Attributes inherited from GeographicItem

#geometry, #line_string, #multi_line_string, #multi_point, #multi_polygon, #point, #polygon, #shape, #type

Attributes included from Housekeeping::Users

#by

Instance Method Summary (collapse)

Methods inherited from GeographicItem

are_contained_in_item, are_contained_in_item_by_id, are_contained_in_wkt, #center_coords, #centroid, contained_by, contained_by_where_sql, contained_by_with_antimeridian_check, contained_by_wkt_shifted_sql, contained_by_wkt_sql, containing, #containing_geographic_areas, containing_point, containing_sql, containing_where_for_point_sql, containing_where_sql, containing_where_sql_geog, #contains?, crosses_anti_meridian?, crosses_anti_meridian_by_id?, disjoint_from, #distance?, distance_between, eval_for_type, excluding, #far, gather_map_data, gather_selected_data, #geo_object, #geo_object_type, #geo_type, geometry_for, geometry_for_collection_sql, geometry_for_sql, geometry_sql, geometry_sql2, #inferred_geographic_name_hierarchy, intersecting, #intersects?, is_contained_by, is_contained_by_sql, lat_long_sql, #line_string_to_a, #line_string_to_hash, #multi_line_string_to_a, #multi_line_string_to_hash, #multi_point_to_a, #multi_point_to_hash, #multi_polygon_to_a, #multi_polygon_to_hash, #near, ordered_by_area, ordered_by_longest_distance_from, ordered_by_shortest_distance_from, point_inferred_geographic_name_hierarchy, #point_to_a, #point_to_hash, #polygon_to_a, #polygon_to_hash, #quick_geographic_name_hierarchy, reverse_containing_sql, #rgeo_to_geo_json, select_distance_with_geo_object, select_geography_sql, select_geometry_sql, #set_type_if_geography_present, single_geometry_sql, #some_data_is_provided, #st_centroid, st_collect_sql, #st_distance, #st_distance_spheroid, st_multi, #st_npoints, #start_point, #to_geo_json, #to_geo_json_feature, #valid_geometry?, where_distance_greater_than_zero, with_area, with_collecting_event_through_georeferences, with_is_valid_geometry_column, with_latitude, with_longitude, #within?, within_radius_of_item, within_radius_of_item_sql, within_radius_of_wkt_sql

Methods included from Housekeeping::Timestamps

#data_breakdown_for_chartkick_recent

Methods included from Housekeeping::Users

#set_created_by_id, #set_updated_by_id

Methods included from ActiverecordUtilities

#trim_attributes

Instance Method Details

- (Object) keystone_error_box



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

def keystone_error_box
  geo_object
end

- (Hash) rendering_hash

Returns:

  • (Hash)


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

def rendering_hash
  polygon_to_hash(self.polygon)
end

- (RGeo::Point) st_start_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

- (Array) to_a

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