Class: MySociety::MapIt::Point
- Inherits:
-
Object
- Object
- MySociety::MapIt::Point
- Includes:
- LocalAuthorityFinder, UriToHash
- Defined in:
- lib/my_society/map_it.rb
Constant Summary collapse
- SYSTEM_WGS84 =
4326
- SYSTEM_IRISH_NATIONAL_GRID =
29902
- SYSTEM_BRITISH_NATIONAL_GRID =
27700
Constants included from LocalAuthorityFinder
LocalAuthorityFinder::COUNTY_TYPE_CODES, LocalAuthorityFinder::COUNTY_WARD_TYPE_CODES, LocalAuthorityFinder::DISTRICT_TYPE_CODES, LocalAuthorityFinder::PARISH_TYPE_CODES, LocalAuthorityFinder::UNITARY_TYPE_CODES, LocalAuthorityFinder::WARD_TYPE_CODES
Instance Attribute Summary collapse
-
#coordinate_system ⇒ Object
readonly
Returns the value of attribute coordinate_system.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x, y, coordinate_system = SYSTEM_WGS84) ⇒ Point
constructor
A new instance of Point.
- #to_point ⇒ Object
- #uri ⇒ Object
Methods included from UriToHash
Methods included from LocalAuthorityFinder
#county, #county_ward, #detect, #district, #local_authority, #parish, #two_tier?, #unitary, #ward
Constructor Details
#initialize(x, y, coordinate_system = SYSTEM_WGS84) ⇒ Point
Returns a new instance of Point.
153 154 155 156 157 |
# File 'lib/my_society/map_it.rb', line 153 def initialize x, y, coordinate_system = SYSTEM_WGS84 self.x = x self.y = y self.coordinate_system = coordinate_system end |
Instance Attribute Details
#coordinate_system ⇒ Object
Returns the value of attribute coordinate_system.
150 151 152 |
# File 'lib/my_society/map_it.rb', line 150 def coordinate_system @coordinate_system end |
#x ⇒ Object
Returns the value of attribute x.
144 145 146 |
# File 'lib/my_society/map_it.rb', line 144 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
147 148 149 |
# File 'lib/my_society/map_it.rb', line 147 def y @y end |