Class: VORuby::STC::V1_30::UnionType
- Inherits:
-
RegionType
- Object
- STCBaseType
- CoordIntervalType
- SpatialIntervalType
- RegionType
- VORuby::STC::V1_30::UnionType
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
The union of two or more regions is a region.
Instance Attribute Summary collapse
-
#regions ⇒ Object
Returns the value of attribute regions.
Attributes inherited from RegionType
#area, #coord_system_id, #note
Attributes inherited from SpatialIntervalType
Attributes inherited from CoordIntervalType
#fill_factor, #frame_id, #hi_include, #lo_include
Attributes included from STCReference
#id, #idref, #ucd, #xlink_href, #xlink_type
Class Method Summary collapse
Instance Method Summary collapse
- #==(u) ⇒ Object
-
#initialize(regions, area = nil, lo_include = true, hi_include = true, options = {}) ⇒ UnionType
constructor
A new instance of UnionType.
- #to_s ⇒ Object
- #to_xml(name = nil) ⇒ Object
Methods inherited from RegionType
Methods inherited from SpatialIntervalType
Methods inherited from CoordIntervalType
coord_interval_from_xml, #hi_include?, #lo_include?
Methods inherited from STCBaseType
Methods included from STCReference
#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml
Methods included from SerializableToXml
Constructor Details
#initialize(regions, area = nil, lo_include = true, hi_include = true, options = {}) ⇒ UnionType
Returns a new instance of UnionType.
5925 5926 5927 5928 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5925 def initialize(regions, area=nil, lo_include=true, hi_include=true, ={}) super(area, lo_include, hi_include, ) self.regions = regions end |
Instance Attribute Details
#regions ⇒ Object
Returns the value of attribute regions.
5923 5924 5925 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5923 def regions @regions end |
Class Method Details
.from_xml(xml) ⇒ Object
5957 5958 5959 5960 5961 5962 5963 5964 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5957 def self.from_xml(xml) root = element_from(xml) self.new( RegionList.new(xml_to_obj(root, Region)), *RegionType.region_from_xml(root) ) end |
Instance Method Details
#==(u) ⇒ Object
5939 5940 5941 5942 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5939 def ==(u) super(u) and self.regions = u.regions end |
#to_s ⇒ Object
5953 5954 5955 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5953 def to_s "UNION(#{self.regions})" end |
#to_xml(name = nil) ⇒ Object
5944 5945 5946 5947 5948 5949 5950 5951 |
# File 'lib/voruby/stc/1.30/stc.rb', line 5944 def to_xml(name=nil) el = super(name) self.regions.each{ |r| el.add_element(r.to_xml) } collapse_namespaces(el) el end |