class 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[R]

Float. Altitude

alt_unit[RW]

String. Altitude unit.

geodetic_datum[RW]

Geodedic datum / map datum

lat[R]

Float. Latitude

long[R]

Float. Longitute

Public Instance Methods

alt=(str) click to toggle source

Float. Altitude

    # File lib/bio-phyloxml/phyloxml_elements.rb
460 def alt=(str)
461   @alt = str.to_f unless str.nil?
462 end
lat=(str) click to toggle source

Float. Latitude

    # File lib/bio-phyloxml/phyloxml_elements.rb
450 def lat=(str)
451   @lat = str.to_f unless str.nil?
452 end
long=(str) click to toggle source

Float. Longitute

    # File lib/bio-phyloxml/phyloxml_elements.rb
455 def long=(str)
456   @long = str.to_f unless str.nil?
457 end
to_xml() click to toggle source

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

    # File lib/bio-phyloxml/phyloxml_elements.rb
465 def to_xml
466   raise "Geodedic datum is a required attribute of Point element." if @geodetic_datum.nil?
467 
468   p = LibXML::XML::Node.new('point')
469   p["geodetic_datum"] = @geodetic_datum
470   p["alt_unit"] = @alt_unit if @alt_unit != nil
471   PhyloXML::Writer.generate_xml(p, self, [
472       [:simple, 'lat', @lat],
473       [:simple, 'long', @long],
474       [:simple, 'alt', @alt]])
475   return p
476   #@todo check if characters are correctly generated, like Zuric
477 end