Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/gdal/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ module Utils
autoload :Translate, File.expand_path("utils/translate", __dir__)
autoload :VectorTranslate, File.expand_path("utils/vector_translate", __dir__)
autoload :Warp, File.expand_path("utils/warp", __dir__)
autoload :Footprint, File.expand_path("utils/footprint", __dir__)
end
end
66 changes: 66 additions & 0 deletions lib/gdal/utils/footprint.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# frozen_string_literal: true

require_relative "footprint/options"

module GDAL
module Utils
# Wrapper for gdal_footprint using GDALFootprint C API.
#
# @see https://gdal.org/programs/gdal_footprint.html gdal_footprint utility documentation.
# @see https://gdal.org/api/gdal_utils.html#_CPPv413GDALFootprintPKc12GDALDatasetH12GDALDatasetHPK20GDALFootprintOptionsPi
# GDALFootprint C API.
class Footprint
# Perform the gdal_footprint (GDALFootprint) operation.
#
# @example Footprint a dataset with options (for dst_dataset_path).
# src_dataset = GDAL::Dataset.open("source.tif", "r")
# options = GDAL::Utils::Footprint::Options.new(options: ["-srcnodata", "0", "-t_srs", "EPSG:4326"])
#
# dataset = GDAL::Utils::Footprint.perform(
# dst_dataset_path: "destination.tif",
# src_dataset: src_dataset,
# options: options
# )
#
# # Do something with the dataset.
# puts dataset.layer_count
#
# # You must close the dataset when you are done with it.
# dataset.close
# src_dataset.close
#
# @param dst_dataset_path [String] The path to the destination dataset.
# @param src_dataset [GDAL::Dataset] The source dataset.
# @param options [GDAL::Utils::Footprint::Options] The options for the operation.
# @param block [Proc] The block to be executed with the dataset.
# @yield [GDAL::Dataset] The resulting dataset.
# @return [GDAL::Dataset] The resulting dataset (only if block is not specified).
def self.perform(src_dataset:, dst_dataset_path:, options: Options.new, &block)
dst_dataset_ptr = result_dataset_ptr(
dst_dataset_path: dst_dataset_path, src_dataset: src_dataset, options: options
)

GDAL::Dataset.release(dst_dataset_ptr) # Release the dataset pointer to save Datasource content.

::OGR::DataSource.open(dst_dataset_path, "w", &block)
end

def self.result_dataset_ptr(src_dataset:, dst_dataset_path:, options: Options.new)
result_code_ptr = ::FFI::MemoryPointer.new(:int)
dst_dataset_ptr = ::FFI::GDAL::Utils.GDALFootprint(
dst_dataset_path,
nil, # pszDest
src_dataset.c_pointer,
options.c_pointer,
result_code_ptr
)
success = result_code_ptr.read_int.zero?

raise ::GDAL::Error, "GDALFootprint failed." if dst_dataset_ptr.null? || !success

dst_dataset_ptr
end
private_class_method :result_dataset_ptr
end
end
end
52 changes: 52 additions & 0 deletions lib/gdal/utils/footprint/options.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# frozen_string_literal: true

module GDAL
module Utils
class Footprint
# Ruby wrapper for GDALFootprintOptions C API (options for gdal_footprint utility).
#
# @see GDAL::Utils::Footprint
# @see https://gdal.org/programs/gdal_footprint.html gdal_footprint utility documentation.
class Options
# @private
class AutoPointer < ::FFI::AutoPointer
# @param pointer [FFI::Pointer]
def self.release(pointer)
return unless pointer && !pointer.null?

::FFI::GDAL::Utils.GDALFootprintOptionsFree(pointer)
end
end

# @return [AutoPointer] C pointer to the GDALFootprintOptions.
attr_reader :c_pointer

# @return [Array<String>] The options.
attr_reader :options

# Create a new instance.
#
# @see https://gdal.org/programs/gdal_footprint.html
# List of available options could be found in gdal_footprint utility documentation.
#
# @example Create a new instance.
# options = GDAL::Utils::Footprint::Options.new(options: ["-srcnodata", "0", "-t_srs", "EPSG:4326"])
#
# @param options [Array<String>] The options list.
def initialize(options: [])
@options = options
@string_list = ::GDAL::Utils::Helpers::StringList.new(strings: options)
@c_pointer = AutoPointer.new(options_pointer)
end

private

attr_reader :string_list

def options_pointer
::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil)
end
end
end
end
end
40 changes: 40 additions & 0 deletions spec/unit/gdal/utils/footprint/options_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: true

require "spec_helper"
require "gdal"

RSpec.describe GDAL::Utils::Rasterize::Options do
context "when no options are provided" do
it "returns a new instance of Options" do
subject { described_class.new }

expect(subject).to be_a(described_class)
expect(subject.c_pointer).to be_a(described_class::AutoPointer)
expect(subject.c_pointer).not_to be_null
end
end

context "when options are provided" do
subject { described_class.new(options: options) }

let(:options) { ["-of", "GTiff", "-ts", "10", "10"] }

it "returns a new instance of Options with options" do
expect(subject).to be_a(described_class)
expect(subject.c_pointer).to be_a(described_class::AutoPointer)
expect(subject.c_pointer).not_to be_null
end
end

context "when incorrect options are provided" do
subject { described_class.new(options: options) }

let(:options) { ["-unknown123"] }

it "raises exception" do
expect { subject }.to raise_exception(
GDAL::UnsupportedOperation, "Unknown option name '-unknown123'"
)
end
end
end
61 changes: 61 additions & 0 deletions spec/unit/gdal/utils/footprint_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# frozen_string_literal: true

require "spec_helper"
require "gdal"
require "ogr"

RSpec.describe GDAL::Utils::Footprint do
let(:src_dataset) { GDAL::Dataset.open(src_dataset_path, "r") }

after { src_dataset.close }

describe ".perform" do
let(:dst_dataset_path) { "/vsimem/test-#{SecureRandom.uuid}.geojson" }

context "when options are provided for valid tiff" do
let(:expected_wkt) do
"MULTIPOLYGON (((-117.641721475391 33.9438318680271,-117.641718643113 33.6649697255499," \
"-117.308745395101 33.664972062262,-117.308748199413 33.9438342216806," \
"-117.641721475391 33.9438318680271)))"
end

let(:src_dataset_path) do
path = "../../../../spec/support/images/osgeo/geotiff/gdal_eg/cea.tif"
File.expand_path(path, __dir__)
end

it "returns new dataset with options applied" do

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.2 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.0 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.3 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for module FFI::GDAL::Utils

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.0 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.1 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) ^^^^^^^^^^^^^^^^^^^^^^^^ Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.0 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.2 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.6 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.2 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.6 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.7 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.1 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) ^^^^^^^^^^^^^^^^^^^^^^^^ Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.0 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.6 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.7 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.6 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.3 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for module FFI::GDAL::Utils

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.3 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for module FFI::GDAL::Utils

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.1 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) ^^^^^^^^^^^^^^^^^^^^^^^^ Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.3 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for module FFI::GDAL::Utils

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.7 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.2 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.7 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 27 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.1 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for valid tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) ^^^^^^^^^^^^^^^^^^^^^^^^ Did you mean? GDALRasterizeOptionsNew
options = GDAL::Utils::Footprint::Options.new(options: ["-t_srs", "EPSG:4326"])

described_class.perform(
dst_dataset_path: dst_dataset_path,
src_dataset: src_dataset,
options: options
) do |new_dataset|
expect(new_dataset).to be_a(OGR::DataSource)
expect(new_dataset.layer(0).feature_count).to eq(1)
expect(new_dataset.layer(0).feature(0).geometry.to_wkt).to eq(expected_wkt)
end
end
end

context "when options are provided for empty tiff" do
let(:src_dataset_path) do
path = "../../../../spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.tif"
File.expand_path(path, __dir__)
end

it "returns new dataset with options applied" do

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.2 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.0 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.3 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for module FFI::GDAL::Utils

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.0 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.1 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) ^^^^^^^^^^^^^^^^^^^^^^^^ Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.0 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.2 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.6 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.2 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.6 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.7 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.1 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) ^^^^^^^^^^^^^^^^^^^^^^^^ Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.0 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.6 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.7 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.6 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.3 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for module FFI::GDAL::Utils

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.3 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for module FFI::GDAL::Utils

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.1 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) ^^^^^^^^^^^^^^^^^^^^^^^^ Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.3 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for module FFI::GDAL::Utils

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.7 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.2 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 2.7 on ubuntu-20.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module Did you mean? GDALRasterizeOptionsNew

Check failure on line 48 in spec/unit/gdal/utils/footprint_spec.rb

View workflow job for this annotation

GitHub Actions / Test on Ruby 3.1 on ubuntu-22.04

GDAL::Utils::Footprint.perform when options are provided for empty tiff returns new dataset with options applied Failure/Error: ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) NoMethodError: undefined method `GDALFootprintOptionsNew' for FFI::GDAL::Utils:Module ::FFI::GDAL::Utils.GDALFootprintOptionsNew(string_list.c_pointer, nil) ^^^^^^^^^^^^^^^^^^^^^^^^ Did you mean? GDALRasterizeOptionsNew
options = GDAL::Utils::Footprint::Options.new(options: ["-t_srs", "EPSG:4326"])

new_dataset = described_class.perform(
dst_dataset_path: dst_dataset_path, src_dataset: src_dataset, options: options
)

expect(new_dataset.layer(0).feature_count).to eq(0)

new_dataset.close
end
end
end
end
Loading