Module: GD::GIS::Extents
- Defined in:
- lib/gd/gis/extents.rb
Overview
Note:
Bounding boxes are approximate and intended for visualization.
Provides access to predefined geographic extents loaded from a JSON dataset.
Extents are WGS84 bounding boxes defined as:
- min_lng, min_lat, max_lng, max_lat
-
Supports lookup by symbolic name.
Constant Summary collapse
- DATA_PATH =
File.( "data/extents_global.json", __dir__ )
Class Method Summary collapse
Class Method Details
.[](name) ⇒ Object
38 39 40 |
# File 'lib/gd/gis/extents.rb', line 38 def [](name) fetch(name) end |
.all ⇒ Object
42 43 44 45 |
# File 'lib/gd/gis/extents.rb', line 42 def all load_data! @extents.keys.map(&:to_sym) end |
.fetch(name) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/gd/gis/extents.rb', line 31 def fetch(name) load_data! @extents.fetch(name.to_s.downcase) do raise ArgumentError, "Unknown extent: #{name}" end end |