Class: FrOData::Properties::Geography::LineString
- Inherits:
-
Base
show all
- Defined in:
- lib/frodata/properties/geography/line_string.rb
Constant Summary
Constants inherited
from Base
Base::DEFAULT_SRID
Instance Attribute Summary
Attributes inherited from Base
#srid
#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=
#==, #allows_nil?, #concurrency_mode, from_xml, #initialize, #json_value, #strict?, #to_xml, #url_value
Instance Method Details
#coords_from_s(str) ⇒ Object
13
14
15
|
# File 'lib/frodata/properties/geography/line_string.rb', line 13
def coords_from_s(str)
str.split(',').map { |pos| pos.split(' ').map(&:to_f) }
end
|
#coords_to_s ⇒ Object
9
10
11
|
# File 'lib/frodata/properties/geography/line_string.rb', line 9
def coords_to_s
value.map { |pos| pos.join(' ') }.join(',')
end
|
#type ⇒ Object
5
6
7
|
# File 'lib/frodata/properties/geography/line_string.rb', line 5
def type
'Edm.GeographyLineString'
end
|
#xml_value ⇒ Object
17
18
19
20
21
|
# File 'lib/frodata/properties/geography/line_string.rb', line 17
def xml_value
value.map do |coords|
{ pos: coords.join(' ') }
end
end
|