lib/rcap/base/polygon.rb in rcap-2.1.0 vs lib/rcap/base/polygon.rb in rcap-2.2.0

- old
+ new

@@ -51,12 +51,12 @@ if !polygon_xml_element.text.nil? && !polygon_xml_element.text.empty? coordinates = self.parse_polygon_string( polygon_xml_element.text ) self.new do |polygon| coordinates.each do |lattitude, longitude| polygon.add_point do |point| - point.lattitude = lattitude - point.longitude = longitude + point.lattitude = lattitude.to_f + point.longitude = longitude.to_f end end end else self.new @@ -83,12 +83,12 @@ # @return [Polygon] def self.from_yaml_data( polygon_yaml_data ) self.new do |polygon| Array( polygon_yaml_data ).each do |lattitude, longitude| polygon.add_point do |point| - point.lattitude = lattitude - point.longitude = longitude + point.lattitude = lattitude.to_f + point.longitude = longitude.to_f end end end end @@ -102,11 +102,11 @@ # @return [Polygon] def self.from_h( polygon_hash ) self.new do |polygon| Array( polygon_hash[ POINTS_KEY ]).each do |point_array| polygon.add_point do |point| - point.lattitude = point_array[ Point::LATTITUDE_INDEX ] - point.longitude = point_array[ Point::LONGITUDE_INDEX ] + point.lattitude = point_array[ Point::LATTITUDE_INDEX ].to_f + point.longitude = point_array[ Point::LONGITUDE_INDEX ].to_f end end end end