forked from telus-agcg/ffi-gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add ubuntu 24.04 with GDAL 3.8.4
- Loading branch information
1 parent
a9b1628
commit 1205d6c
Showing
35 changed files
with
420 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module FFI | ||
module GDAL | ||
module InternalHelpers | ||
autoload :GDALVersion, File.expand_path("internal_helpers/gdal_version", __dir__) | ||
autoload :LayoutVersion, File.expand_path("internal_helpers/layout_version", __dir__) | ||
autoload :LayoutVersionResolver, File.expand_path("internal_helpers/layout_version_resolver", __dir__) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
module FFI | ||
module GDAL | ||
module InternalHelpers | ||
# Version information for GDAL. | ||
class GDALVersion | ||
# @return [String] GDAL Version. | ||
def self.version | ||
::FFI::GDAL.GDALVersionInfo("VERSION_NUM") | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
module FFI | ||
module GDAL | ||
module InternalHelpers | ||
LayoutVersion = ::Struct.new(:version, :layout, keyword_init: true) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
module FFI | ||
module GDAL | ||
module InternalHelpers | ||
# Resolve the layout version based on the GDAL version. | ||
class LayoutVersionResolver | ||
# Resolve the layout version based on the GDAL version. | ||
# @param versions [Array<InternalHelpers::LayoutVersion>] The versions to resolve. | ||
# @return [Array<Symbol, Integer>] The resolved layout. | ||
def self.resolve(versions: []) | ||
gdal_version = GDALVersion.version | ||
|
||
versions | ||
.sort_by(&:version) | ||
.reverse_each | ||
.find { |layout_version| gdal_version >= layout_version.version } | ||
.layout | ||
.freeze | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
module GDAL | ||
module GridAlgorithms | ||
# Base abstract class for all grid algorithms. | ||
class AlgorithmBase | ||
# @return Options object. | ||
attr_reader :options | ||
|
||
def initialize | ||
@options = options_class.new | ||
assign_size_of_structure | ||
end | ||
|
||
# @return [Class] Options class. | ||
def options_class | ||
# This method must be overridden in subclasses. | ||
end | ||
|
||
# @return [Symbol] C identifier for the algorithm. | ||
def c_identifier | ||
# This method must be overridden in subclasses. | ||
end | ||
|
||
private | ||
|
||
def assign_size_of_structure | ||
# Starting GDAL 3.6.0 we must assign nSizeOfStructure to the size of the structure. | ||
return unless @options.members.include?(:n_size_of_structure) | ||
|
||
@options[:n_size_of_structure] = @options.size | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.