class STAC::Extent::Spatial

Describes the spatial extents of a collection

Attributes

bbox[RW]

Public Class Methods

from_hash(hash) click to toggle source

Deserializes a Spatial from a Hash.

# File lib/stac/extent.rb, line 43
def self.from_hash(hash)
  new(**hash.transform_keys(&:to_sym))
end
new(bbox:, **extra) click to toggle source
# File lib/stac/extent.rb, line 49
def initialize(bbox:, **extra)
  @bbox = bbox
  @extra = extra.transform_keys(&:to_s)
end

Public Instance Methods

to_h() click to toggle source

Serializes self to a Hash.

# File lib/stac/extent.rb, line 55
def to_h
  {
    'bbox' => bbox,
  }.merge(extra)
end