Class: AIXM::Component::Geometry::Point
- Inherits:
-
Object
- Object
- AIXM::Component::Geometry::Point
- Defined in:
- lib/aixm/component/geometry/point.rb
Overview
Points are defined by #xy coordinates.
Cheat Sheet in Pseudo Code:
point = AIXM.point(
xy: AIXM.xy
)
Instance Attribute Summary collapse
-
#xy ⇒ AIXM::XY
(starting) point.
Instance Method Summary collapse
-
#initialize(xy:) ⇒ Point
constructor
A new instance of Point.
- #inspect ⇒ String
-
#to_xml ⇒ String
AIXM or OFMX markup.
Constructor Details
#initialize(xy:) ⇒ Point
19 20 21 |
# File 'lib/aixm/component/geometry/point.rb', line 19 def initialize(xy:) self.xy = xy end |
Instance Attribute Details
#xy ⇒ AIXM::XY
17 18 19 |
# File 'lib/aixm/component/geometry/point.rb', line 17 def xy @xy end |
Instance Method Details
#inspect ⇒ String
24 25 26 |
# File 'lib/aixm/component/geometry/point.rb', line 24 def inspect %Q(#<#{self.class} xy="#{xy}">) end |
#to_xml ⇒ String
34 35 36 37 38 39 40 41 42 |
# File 'lib/aixm/component/geometry/point.rb', line 34 def to_xml builder = Builder::XmlMarkup.new(indent: 2) builder.Avx do |avx| avx.codeType('GRC') avx.geoLat(xy.lat(AIXM.schema)) avx.geoLong(xy.long(AIXM.schema)) avx.codeDatum('WGE') end end |