Sha256: f5ca6c8cc0f26ac1ff5dca5319a757172c099b05c15d5ce81d6952fb8c3f8faa
Contents?: true
Size: 801 Bytes
Versions: 18
Compression:
Stored size: 801 Bytes
Contents
module Frodo module Properties module Geography class Polygon < Base def type 'Edm.GeographyPolygon' end def coords_to_s '(' + value.map { |pos| pos.join(' ') }.join(',') + ')' end def coords_from_s(str) str.gsub(/[()]/, '') .split(',').map { |pos| pos.split(' ').map(&:to_f) } end def xml_value { exterior: { LinearRing: value.map do |coords| { pos: coords.join(' ') } end } } end private def self.parse_xml(property_xml) property_xml.xpath('//pos').map do |el| el.content.split(' ').map(&:to_f) end end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems