Class: VORuby::STC::V1_10::STC::ObsDataLocationType
- Inherits:
-
StcMetadataType
- Object
- StcMetadataType
- VORuby::STC::V1_10::STC::ObsDataLocationType
- Defined in:
- lib/voruby/stc/1.10/stc.rb
Overview
Type for observational STC metadata. Describes the spatial and temporal volume covered by an observation.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#observation_location ⇒ Object
Returns the value of attribute observation_location.
-
#observatory_location ⇒ Object
Returns the value of attribute observatory_location.
-
#pixel_space ⇒ Object
Returns the value of attribute pixel_space.
Attributes inherited from StcMetadataType
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ObsDataLocationType
constructor
A new instance of ObsDataLocationType.
- #to_xml(name = nil) ⇒ Object
Methods inherited from StcMetadataType
Methods included from SerializableToXml
Constructor Details
#initialize(options = {}) ⇒ ObsDataLocationType
Returns a new instance of ObsDataLocationType.
3182 3183 3184 3185 3186 |
# File 'lib/voruby/stc/1.10/stc.rb', line 3182 def initialize(={}) raise_argument_required_error('observatory location') if !.has_key?(:observatory_location) raise_argument_required_error('observation location') if !.has_key?(:observation_location) super() end |
Instance Attribute Details
#observation_location ⇒ Object
Returns the value of attribute observation_location.
3180 3181 3182 |
# File 'lib/voruby/stc/1.10/stc.rb', line 3180 def observation_location @observation_location end |
#observatory_location ⇒ Object
Returns the value of attribute observatory_location.
3180 3181 3182 |
# File 'lib/voruby/stc/1.10/stc.rb', line 3180 def observatory_location @observatory_location end |
#pixel_space ⇒ Object
Returns the value of attribute pixel_space.
3180 3181 3182 |
# File 'lib/voruby/stc/1.10/stc.rb', line 3180 def pixel_space @pixel_space end |
Class Method Details
.from_xml(xml) ⇒ Object
3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 |
# File 'lib/voruby/stc/1.10/stc.rb', line 3219 def self.from_xml(xml) root = element_from(xml) = { :observatory_location => ObservatoryLocation.from_xml( REXML::XPath.first(root, 'x:ObservatoryLocation', {'x' => obj_ns.uri}) ), :observation_location => ObservationLocation.from_xml( REXML::XPath.first(root, 'x:ObservationLocation', {'x' => obj_ns.uri}) ) } id = root.attributes.get_attribute_ns(obj_ns.uri, 'ID') [:id] = id.value if id pixel_space = REXML::XPath.first(root, 'x:PixelSpace', {'x' => obj_ns.uri}) [:pixel_space] = PixelSpace.from_xml(pixel_space) if pixel_space self.new() end |
Instance Method Details
#to_xml(name = nil) ⇒ Object
3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 |
# File 'lib/voruby/stc/1.10/stc.rb', line 3208 def to_xml(name=nil) el = super(name) el.add_element(self.observatory_location.to_xml('ObservatoryLocation')) el.add_element(self.observation_location.to_xml('ObservationLocation')) el.add_element(self.pixel_space.to_xml('PixelSpace')) if self.pixel_space collapse_namespaces(el) el end |