Sha256: 8c2f749a72133d1d084b96aa9eefc486b5bcb3d72acdd8137f95f7f7bcedbfe7
Contents?: true
Size: 1.15 KB
Versions: 2
Compression:
Stored size: 1.15 KB
Contents
module OGR module GeometryTypes module Collection def collection? true end # If this geometry is a container, this fetches the geometry at the # sub_geometry_index. # # @param sub_geometry_index [Fixnum] # @return [OGR::Geometry] def geometry_at(sub_geometry_index) build_geometry do |ptr| FFI::GDAL.OGR_G_GetGeometryRef(ptr, sub_geometry_index) end end # Build a ring from a bunch of arcs. # # @param tolerance [Float] # @param auto_close [Boolean] # @return [OGR::Geometry] def polygon_from_edges(tolerance, auto_close) best_effort = false ogrerr_ptr = FFI::MemoryPointer.new(:pointer) new_geometry_ptr = FFI::GDAL.OGRBuildPolygonFromEdges(@geometry_pointer, best_effort, auto_close, tolerance, ogrerr_ptr) ogrerr_int = ogrerr_ptr.read_int ogrerr = FFI::GDAL::OGRErr[ogrerr_int] if ogrerr == :OGRERR_FAILURE raise "Couldn't create polygon" end self.class._to_geometry_type(new_geometry_ptr) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ffi-gdal-1.0.0.beta3 | lib/ogr/geometry_types/collection.rb |
ffi-gdal-1.0.0.beta1 | lib/ogr/geometry_types/collection.rb |