class Bio::PhyloXML::Distribution

Description

The geographic distribution of the items of a clade (species, sequences), intended for phylogeographic applications.

Attributes

desc[RW]

String. Free text description of location.

points[RW]

Array of Point objects. Holds coordinates of the location.

polygons[RW]

Array of Polygon objects.

Public Class Methods

new() click to toggle source
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 420
def initialize
  @points = []
  @polygons = []
end

Public Instance Methods

to_xml() click to toggle source

Converts elements to xml representation. Called by PhyloXML::Writer class.

# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 427
def to_xml
  distr = LibXML::XML::Node.new('distribution')
  PhyloXML::Writer.generate_xml(distr, self, [
      [:simple, 'desc', @desc],
      [:objarr, 'point', 'points'],
      [:objarr, 'polygon', 'polygons']])
  return distr
end