lib/postgis_functions/polygon.rb in nofxx-postgis_adapter-0.1.7 vs lib/postgis_functions/polygon.rb in nofxx-postgis_adapter-0.1.8
- old
+ new
@@ -13,11 +13,11 @@
# Area is in the units of the spatial reference system.
#
# Returns Float ST_Area(geometry g1);
#
def area
- postgis_calculate(:area, self)
+ postgis_calculate(:area, self).to_f
end
#
# Returns the 2D perimeter of the geometry if it is a ST_Surface, ST_MultiSurface
# (Polygon, Multipolygon). 0 is returned for non-areal geometries. For linestrings
@@ -25,20 +25,20 @@
# the geometry.
#
# Returns Float ST_Perimeter(geometry g1);
#
def perimeter
- postgis_calculate(:perimeter, self)
+ postgis_calculate(:perimeter, self).to_f
end
#
# Returns the 3-dimensional perimeter of the geometry, if it is a polygon or multi-polygon.
# If the geometry is 2-dimensional, then the 2-dimensional perimeter is returned.
#
# Returns Float ST_Perimeter3D(geometry geomA);
#
def perimeter3d
- postgis_calculate(:perimeter3d, self)
+ postgis_calculate(:perimeter3d, self).to_f
end
#
# True if the LineString's start and end points are coincident.
#
\ No newline at end of file