Parent

Class/Module Index [+]

Quicksearch

Bio::PhyloXML::Point

Description

The coordinates of a point with an optional altitude. Required attribute 'geodetic_datum' is used to indicate the geodetic datum (also called 'map datum'), for example Google's KML uses 'WGS84'.

Attributes

alt[RW]

Float. Altitude

alt_unit[RW]

String. Altitude unit.

geodetic_datum[RW]

Geodedic datum / map datum

lat[RW]

Float. Latitude

long[RW]

Float. Longitute

Public Instance Methods

alt=(str) click to toggle source
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 462
def alt=(str)
  @alt = str.to_f unless str.nil?
end
lat=(str) click to toggle source
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 454
def lat=(str)
  @lat = str.to_f unless str.nil?
end
long=(str) click to toggle source
# File lib/bio/db/phyloxml/phyloxml_elements.rb, line 458
def long=(str)
  @long = str.to_f unless str.nil?
end
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 467
def to_xml
  raise "Geodedic datum is a required attribute of Point element." if @geodetic_datum.nil?

  p = LibXML::XML::Node.new('point')
  p["geodetic_datum"] = @geodetic_datum
  p["alt_unit"] = @alt_unit if @alt_unit != nil
  PhyloXML::Writer.generate_xml(p, self, [
      [:simple, 'lat', @lat],
      [:simple, 'long', @long],
      [:simple, 'alt', @alt]])
  return p
  #@todo check if characters are correctly generated, like Zuric
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.