Class: FrOData::Properties::Geography::Point

Inherits:
Base show all
Defined in:
lib/frodata/properties/geography/point.rb

Constant Summary

Constants inherited from Base

Base::DEFAULT_SRID

Instance Attribute Summary

Attributes inherited from Base

#srid

Attributes inherited from FrOData::Property

#name, #options, #value

Instance Method Summary collapse

Methods inherited from Base

#crs, #crs_name, from_xml, #initialize, #json_value, #srs_name, #to_xml, #url_value, #value=

Methods inherited from FrOData::Property

#==, #allows_nil?, #concurrency_mode, from_xml, #initialize, #json_value, #strict?, #to_xml, #url_value

Constructor Details

This class inherits a constructor from FrOData::Properties::Geography::Base

Instance Method Details

#coords_from_s(str) ⇒ Object



13
14
15
# File 'lib/frodata/properties/geography/point.rb', line 13

def coords_from_s(str)
  str.split(' ').map(&:to_f)
end

#coords_to_sObject



9
10
11
# File 'lib/frodata/properties/geography/point.rb', line 9

def coords_to_s
  value.join(' ')
end

#typeObject



5
6
7
# File 'lib/frodata/properties/geography/point.rb', line 5

def type
  'Edm.GeographyPoint'
end

#xml_valueObject



17
18
19
# File 'lib/frodata/properties/geography/point.rb', line 17

def xml_value
  { pos: coords_to_s }
end