Class: VORuby::STC::V1_30::IntersectionType

Inherits:
RegionType show all
Defined in:
lib/voruby/stc/1.30/stc.rb

Overview

The intersection of two or more regions is a region.

Direct Known Subclasses

Intersection, Intersection2

Instance Attribute Summary collapse

Attributes inherited from RegionType

#area, #coord_system_id, #note

Attributes inherited from SpatialIntervalType

#epoch, #unit

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

Methods inherited from RegionType

region_from_xml

Methods inherited from SpatialIntervalType

spatial_interval_from_xml

Methods inherited from CoordIntervalType

coord_interval_from_xml, #hi_include?, #lo_include?

Methods inherited from STCBaseType

stc_base_from_xml

Methods included from STCReference

#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml

Methods included from SerializableToXml

#element

Constructor Details

#initialize(regions, area = nil, lo_include = true, hi_include = true, options = {}) ⇒ IntersectionType

Returns a new instance of IntersectionType.



5971
5972
5973
5974
# File 'lib/voruby/stc/1.30/stc.rb', line 5971

def initialize(regions, area=nil, lo_include=true, hi_include=true, options={})
  super(area, lo_include, hi_include, options)
  self.regions = regions
end

Instance Attribute Details

#regionsObject

Returns the value of attribute regions.



5969
5970
5971
# File 'lib/voruby/stc/1.30/stc.rb', line 5969

def regions
  @regions
end

Class Method Details

.from_xml(xml) ⇒ Object



6003
6004
6005
6006
6007
6008
6009
6010
# File 'lib/voruby/stc/1.30/stc.rb', line 6003

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



5985
5986
5987
5988
# File 'lib/voruby/stc/1.30/stc.rb', line 5985

def ==(u)
  super(u) and
  self.regions = u.regions
end

#to_sObject



5999
6000
6001
# File 'lib/voruby/stc/1.30/stc.rb', line 5999

def to_s
  "INTERSECT(#{self.regions})"
end

#to_xml(name = nil) ⇒ Object



5990
5991
5992
5993
5994
5995
5996
5997
# File 'lib/voruby/stc/1.30/stc.rb', line 5990

def to_xml(name=nil)
  el = super(name)
  
  self.regions.each{ |r| el.add_element(r.to_xml) }
  
  collapse_namespaces(el)
  el
end