Class: APDM::LocalPaperArea
- Inherits:
-
Object
- Object
- APDM::LocalPaperArea
- Defined in:
- lib/apdm/local_paper_area.rb
Instance Attribute Summary collapse
-
#factory ⇒ Object
readonly
Returns the value of attribute factory.
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
Instance Method Summary collapse
- #contains?(lon, lat) ⇒ Boolean
-
#initialize(geojson) ⇒ LocalPaperArea
constructor
A new instance of LocalPaperArea.
Constructor Details
#initialize(geojson) ⇒ LocalPaperArea
Returns a new instance of LocalPaperArea.
8 9 10 11 |
# File 'lib/apdm/local_paper_area.rb', line 8 def initialize(geojson) @factory = RGeo::Geographic.spherical_factory @feature = RGeo::GeoJSON.decode(geojson, :json_parser => :json) end |
Instance Attribute Details
#factory ⇒ Object (readonly)
Returns the value of attribute factory.
7 8 9 |
# File 'lib/apdm/local_paper_area.rb', line 7 def factory @factory end |
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
7 8 9 |
# File 'lib/apdm/local_paper_area.rb', line 7 def feature @feature end |
Instance Method Details
#contains?(lon, lat) ⇒ Boolean
13 14 15 |
# File 'lib/apdm/local_paper_area.rb', line 13 def contains?(lon, lat) feature.contains? factory.point(lon, lat) end |