Sha256: d5aea5c867b0b179bae5ffe22e3eba15948233052c15e7333897b72e9828b231

Contents?: true

Size: 573 Bytes

Versions: 6

Compression:

Stored size: 573 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&.linear_units
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ffi-gdal-1.1.0 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.4 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.3 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.2 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.1 lib/ogr/geometry_types/surface.rb
ffi-gdal-1.0.0 lib/ogr/geometry_types/surface.rb