Sha256: 8bd40565f8392bbea0bd2d36d05f51625cc675adb400b2a91099bb18ff6f2468

Contents?: true

Size: 598 Bytes

Versions: 9

Compression:

Stored size: 598 Bytes

Contents

# frozen_string_literal: true

module OGR
  module GeometryTypes
    module Surface
      # Computes area for a LinearRing, Polygon, or MultiPolygon.  The area of
      # the feature is in square units of the spatial reference system in use.
      #
      # @return [Float] 0.0 for unsupported geometry types.
      def area
        FFI::OGR::API.OGR_G_Area(@c_pointer)
      end

      # Returns the units used by the associated OGR::SpatialReference.
      #
      # @return [Hash]
      def area_units
        spatial_reference ? spatial_reference.linear_units : nil
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ffi-gdal-1.0.0.beta16 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.0.beta15 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.0.beta14 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.0.beta13 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.0.beta12 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.0.beta11 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.0.beta10 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.0.beta9 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.0.beta8 lib/ogr/geometry_types/surface.rb