ffi-gdal 1.0.0.beta16 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dockerignore +17 -0
- data/.github/workflows/codacy.yml +61 -0
- data/.github/workflows/codeql.yml +74 -0
- data/.github/workflows/continuous-integration.yml +36 -0
- data/.github/workflows/dependency-review.yml +20 -0
- data/.github/workflows/specs-in-docker.yml +27 -0
- data/.gitignore +3 -0
- data/.rspec +1 -0
- data/.rubocop.yml +10 -80
- data/.rubocop_todo.yml +23 -40
- data/.ruby-version +1 -1
- data/Changelog-0.x.md +512 -0
- data/Changelog.md +12 -0
- data/Dockerfile.gdal2 +110 -0
- data/Dockerfile.gdal3 +73 -0
- data/README.md +25 -14
- data/Rakefile +0 -8
- data/Tiltfile +91 -0
- data/bin/bundle +123 -0
- data/bin/docker-clean +8 -0
- data/bin/rake +29 -0
- data/bin/rspec +29 -0
- data/bin/rubocop +29 -0
- data/docker-compose.yml +25 -0
- data/examples/extract_and_colorize.rb +0 -13
- data/examples/geometries.rb +14 -14
- data/examples/ogr_layer_to_layer.rb +1 -3
- data/examples/raster_erasing.rb +1 -0
- data/examples/remove_small_polygons.rb +1 -1
- data/examples/testing_gdal.rb +20 -17
- data/examples/warping.rb +9 -7
- data/ffi-gdal.gemspec +12 -6
- data/lib/ext/ffi_library_function_checks.rb +2 -2
- data/lib/ext/to_bool.rb +5 -3
- data/lib/ffi/cpl/conv.rb +27 -25
- data/lib/ffi/cpl/error.rb +19 -20
- data/lib/ffi/cpl/hash_set.rb +4 -4
- data/lib/ffi/cpl/http.rb +3 -3
- data/lib/ffi/cpl/http_result.rb +8 -8
- data/lib/ffi/cpl/list.rb +1 -1
- data/lib/ffi/cpl/mime_part.rb +2 -2
- data/lib/ffi/cpl/minixml.rb +7 -7
- data/lib/ffi/cpl/progress.rb +8 -8
- data/lib/ffi/cpl/quad_tree.rb +14 -14
- data/lib/ffi/cpl/rect_obj.rb +3 -3
- data/lib/ffi/cpl/string.rb +17 -20
- data/lib/ffi/cpl/vsi.rb +13 -13
- data/lib/ffi/cpl/xml_node.rb +3 -3
- data/lib/ffi/extensions/gdal/extensions/all.rb +4 -0
- data/lib/ffi/extensions/gdal/extensions/version.rb +9 -0
- data/lib/ffi/extensions/gdal/extensions.rb +12 -0
- data/lib/ffi/extensions/rttopo/gbox.rb +19 -0
- data/lib/ffi/extensions/rttopo/geom.rb +16 -0
- data/lib/ffi/extensions/rttopo.rb +41 -0
- data/lib/ffi/gdal/alg.rb +277 -277
- data/lib/ffi/gdal/color_entry.rb +3 -3
- data/lib/ffi/gdal/gcp.rb +6 -6
- data/lib/ffi/gdal/gdal.rb +349 -349
- data/lib/ffi/gdal/grid.rb +134 -134
- data/lib/ffi/gdal/grid_data_metrics_options.rb +4 -4
- data/lib/ffi/gdal/grid_inverse_distance_to_a_power_options.rb +9 -9
- data/lib/ffi/gdal/grid_moving_average_options.rb +4 -4
- data/lib/ffi/gdal/grid_nearest_neighbor_options.rb +3 -3
- data/lib/ffi/gdal/matching.rb +3 -3
- data/lib/ffi/gdal/rpc_info.rb +17 -17
- data/lib/ffi/gdal/transformer_info.rb +4 -4
- data/lib/ffi/gdal/version.rb +1 -1
- data/lib/ffi/gdal/vrt.rb +39 -39
- data/lib/ffi/gdal/warp_options.rb +34 -34
- data/lib/ffi/gdal/warper.rb +90 -90
- data/lib/ffi/gdal.rb +2 -31
- data/lib/ffi/ogr/api.rb +175 -167
- data/lib/ffi/ogr/contour_writer_info.rb +4 -4
- data/lib/ffi/ogr/core.rb +107 -107
- data/lib/ffi/ogr/envelope.rb +3 -3
- data/lib/ffi/ogr/envelope_3d.rb +5 -5
- data/lib/ffi/ogr/featurestyle.rb +3 -3
- data/lib/ffi/ogr/field.rb +22 -22
- data/lib/ffi/ogr/geocoding.rb +4 -4
- data/lib/ffi/ogr/srs_api.rb +154 -155
- data/lib/ffi/ogr/style_param.rb +3 -3
- data/lib/ffi/ogr/style_value.rb +4 -4
- data/lib/gdal/color_entry.rb +1 -5
- data/lib/gdal/color_interpretation.rb +7 -3
- data/lib/gdal/color_table.rb +46 -27
- data/lib/gdal/cpl_error_handler.rb +26 -6
- data/lib/gdal/data_type.rb +10 -3
- data/lib/gdal/dataset.rb +171 -85
- data/lib/gdal/dataset_mixins/algorithm_methods.rb +44 -44
- data/lib/gdal/dataset_mixins/matching.rb +1 -1
- data/lib/gdal/dataset_mixins/warp_methods.rb +4 -2
- data/lib/gdal/driver.rb +38 -21
- data/lib/gdal/environment_methods.rb +6 -6
- data/lib/gdal/extensions/all.rb +3 -0
- data/lib/gdal/{color_entry_mixins → extensions/color_entry}/extensions.rb +4 -1
- data/lib/gdal/{color_table_mixins → extensions/color_table}/extensions.rb +3 -0
- data/lib/gdal/extensions/dataset/extensions.rb +205 -0
- data/lib/gdal/{driver_mixins → extensions/driver}/extensions.rb +6 -2
- data/lib/gdal/{geo_transform_mixins → extensions/geo_transform}/extensions.rb +10 -8
- data/lib/gdal/{gridder → extensions/gridder}/point_extracting.rb +7 -5
- data/lib/gdal/{gridder.rb → extensions/gridder.rb} +33 -33
- data/lib/gdal/{gridder_options.rb → extensions/gridder_options.rb} +13 -14
- data/lib/gdal/{raster_attribute_table_mixins → extensions/raster_attribute_table}/extensions.rb +8 -6
- data/lib/gdal/{raster_band_mixins → extensions/raster_band}/algorithm_extensions.rb +8 -6
- data/lib/gdal/{raster_band_mixins → extensions/raster_band}/coloring_extensions.rb +6 -4
- data/lib/gdal/{raster_band_mixins → extensions/raster_band}/extensions.rb +9 -5
- data/lib/gdal/{raster_band_mixins → extensions/raster_band}/io_extensions.rb +18 -14
- data/lib/gdal/{raster_band_classifier.rb → extensions/raster_band_classifier.rb} +3 -5
- data/lib/gdal/geo_transform.rb +1 -6
- data/lib/gdal/grid.rb +3 -2
- data/lib/gdal/grid_algorithms.rb +9 -9
- data/lib/gdal/internal_helpers.rb +46 -9
- data/lib/gdal/major_object.rb +11 -3
- data/lib/gdal/options.rb +26 -32
- data/lib/gdal/raster_attribute_table.rb +63 -37
- data/lib/gdal/raster_band.rb +164 -116
- data/lib/gdal/raster_band_mixins/algorithm_methods.rb +26 -25
- data/lib/gdal/rpc_info.rb +3 -2
- data/lib/gdal/transformers/approximate_transformer.rb +12 -3
- data/lib/gdal/transformers/base_general_image_projection_transformer.rb +15 -2
- data/lib/gdal/transformers/gcp_transformer.rb +27 -19
- data/lib/gdal/transformers/general_image_projection_transformer.rb +8 -6
- data/lib/gdal/transformers/general_image_projection_transformer2.rb +9 -6
- data/lib/gdal/transformers/general_image_projection_transformer3.rb +6 -2
- data/lib/gdal/transformers/geolocation_transformer.rb +12 -4
- data/lib/gdal/transformers/reprojection_transformer.rb +11 -3
- data/lib/gdal/transformers/rpc_transformer.rb +11 -2
- data/lib/gdal/transformers/tps_transformer.rb +12 -4
- data/lib/gdal/version_info.rb +2 -2
- data/lib/gdal/virtual_dataset.rb +2 -0
- data/lib/gdal/warp_operation.rb +65 -54
- data/lib/gdal/warp_options.rb +9 -11
- data/lib/ogr/coordinate_transformation.rb +23 -9
- data/lib/ogr/data_source.rb +68 -37
- data/lib/ogr/driver.rb +18 -17
- data/lib/ogr/envelope.rb +0 -3
- data/lib/ogr/error_handling.rb +22 -24
- data/lib/ogr/extensions/all.rb +3 -0
- data/lib/ogr/{data_source_mixins → extensions/data_source}/capability_methods.rb +2 -0
- data/lib/ogr/extensions/data_source/data_source_extensions.rb +16 -0
- data/lib/ogr/{driver_mixins → extensions/driver}/capability_methods.rb +5 -1
- data/lib/ogr/extensions/envelope/extensions.rb +114 -0
- data/lib/ogr/extensions/feature/extensions.rb +87 -0
- data/lib/ogr/extensions/feature_definition/extensions.rb +43 -0
- data/lib/ogr/extensions/geometries/point/extensions.rb +19 -0
- data/lib/ogr/extensions/geometry/container_mixins.rb +56 -0
- data/lib/ogr/extensions/geometry/ewkb_io_extensions.rb +44 -0
- data/lib/ogr/extensions/geometry/ewkb_record.rb +94 -0
- data/lib/ogr/{geometry_mixins → extensions/geometry}/extensions.rb +16 -9
- data/lib/ogr/extensions/geometry/rttopo_extensions.rb +48 -0
- data/lib/ogr/extensions/geometry/wkb_record.rb +63 -0
- data/lib/ogr/extensions/geometry_types/curve/extensions.rb +68 -0
- data/lib/ogr/{layer_mixins → extensions/layer}/capability_methods.rb +4 -0
- data/lib/ogr/{layer_mixins → extensions/layer}/extensions.rb +11 -6
- data/lib/ogr/extensions/spatial_reference/extensions.rb +38 -0
- data/lib/ogr/extensions/spatial_reference/initializers.rb +138 -0
- data/lib/ogr/extensions/style_table/extensions.rb +31 -0
- data/lib/ogr/feature.rb +173 -88
- data/lib/ogr/feature_definition.rb +53 -45
- data/lib/ogr/field.rb +17 -19
- data/lib/ogr/field_definition.rb +30 -18
- data/lib/ogr/geocoder.rb +11 -4
- data/lib/ogr/geometries/line_string.rb +1 -0
- data/lib/ogr/geometries/line_string_25d.rb +0 -9
- data/lib/ogr/geometries/linear_ring.rb +2 -2
- data/lib/ogr/geometries/point.rb +0 -9
- data/lib/ogr/geometry.rb +116 -49
- data/lib/ogr/geometry_field_definition.rb +31 -15
- data/lib/ogr/geometry_types/container.rb +26 -28
- data/lib/ogr/geometry_types/curve.rb +5 -61
- data/lib/ogr/geometry_types/surface.rb +1 -1
- data/lib/ogr/internal_helpers.rb +2 -2
- data/lib/ogr/layer.rb +12 -10
- data/lib/ogr/layer_mixins/ogr_feature_methods.rb +39 -27
- data/lib/ogr/layer_mixins/ogr_field_methods.rb +66 -50
- data/lib/ogr/layer_mixins/ogr_layer_method_methods.rb +17 -8
- data/lib/ogr/layer_mixins/ogr_query_filter_methods.rb +7 -6
- data/lib/ogr/layer_mixins/ogr_sql_methods.rb +15 -7
- data/lib/ogr/spatial_reference.rb +79 -42
- data/lib/ogr/spatial_reference_mixins/coordinate_system_getter_setters.rb +149 -118
- data/lib/ogr/spatial_reference_mixins/exporters.rb +87 -51
- data/lib/ogr/spatial_reference_mixins/importers.rb +88 -43
- data/lib/ogr/spatial_reference_mixins/morphers.rb +12 -8
- data/lib/ogr/spatial_reference_mixins/parameter_getter_setters.rb +27 -13
- data/lib/ogr/style_table.rb +15 -5
- data/lib/ogr/style_tool.rb +29 -15
- data/lib/ogr.rb +1 -0
- data/rakelib/docker.rake +10 -0
- data/sorbet/rbi/hidden-definitions/errors.txt +21790 -0
- data/tilt/gdal2.yml +22 -0
- data/tilt/gdal3.yml +22 -0
- metadata +116 -280
- data/History.md +0 -360
- data/lib/ext/error_symbols.rb +0 -7
- data/lib/gdal/dataset_mixins/extensions.rb +0 -380
- data/lib/gdal/merger.rb +0 -132
- data/lib/ogr/data_source_extensions.rb +0 -10
- data/lib/ogr/envelope_extensions.rb +0 -110
- data/lib/ogr/feature_definition_extensions.rb +0 -39
- data/lib/ogr/feature_extensions.rb +0 -87
- data/lib/ogr/geometry_mixins/container_mixins.rb +0 -25
- data/lib/ogr/spatial_reference_extensions.rb +0 -34
- data/lib/ogr/style_table_extensions.rb +0 -26
- data/spec/ffi-gdal_spec.rb +0 -24
- data/spec/integration/gdal/color_table_info_spec.rb +0 -78
- data/spec/integration/gdal/dataset_info_spec.rb +0 -342
- data/spec/integration/gdal/driver_info_spec.rb +0 -170
- data/spec/integration/gdal/geo_transform_info_spec.rb +0 -226
- data/spec/integration/gdal/gridder_spec.rb +0 -331
- data/spec/integration/gdal/raster_attribute_table_info_spec.rb +0 -229
- data/spec/integration/gdal/raster_band_algorithms_spec.rb +0 -35
- data/spec/integration/gdal/raster_band_info_spec.rb +0 -320
- data/spec/integration/ogr/layer_spec.rb +0 -95
- data/spec/spec_helper.rb +0 -116
- data/spec/support/images/123.tiff +0 -0
- data/spec/support/images/osgeo/gdal/data/hfa/float-rle.img +0 -0
- data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.lgo +0 -31
- data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.tif +0 -0
- data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.tif.msk +0 -0
- data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.txt +0 -10
- data/spec/support/images/osgeo/geotiff/gdal_eg/cea.tif +0 -0
- data/spec/support/images/osgeo/geotiff/gdal_eg/cea.txt +0 -84
- data/spec/support/images/osgeo/geotiff/zi_imaging/image0.lgo +0 -45
- data/spec/support/images/osgeo/geotiff/zi_imaging/image0.tif +0 -0
- data/spec/support/integration_help.rb +0 -34
- data/spec/support/shapefiles/states_21basic/states.dbf +0 -0
- data/spec/support/shapefiles/states_21basic/states.prj +0 -1
- data/spec/support/shapefiles/states_21basic/states.sbn +0 -0
- data/spec/support/shapefiles/states_21basic/states.sbx +0 -0
- data/spec/support/shapefiles/states_21basic/states.shp +0 -0
- data/spec/support/shapefiles/states_21basic/states.shp.xml +0 -3
- data/spec/support/shapefiles/states_21basic/states.shx +0 -0
- data/spec/support/shared_contexts.rb +0 -28
- data/spec/support/shared_examples/gdal/major_object_examples.rb +0 -55
- data/spec/support/shared_examples/ogr/a_25d_geometry.rb +0 -9
- data/spec/support/shared_examples/ogr/a_container_geometry.rb +0 -49
- data/spec/support/shared_examples/ogr/a_geometry.rb +0 -406
- data/spec/support/shared_examples/ogr/a_line_string.rb +0 -18
- data/spec/support/test_style_table.txt +0 -3
- data/spec/support/worldfiles/SR_50M/SR_50M.VERSION.txt +0 -1
- data/spec/support/worldfiles/SR_50M/SR_50M.prj +0 -1
- data/spec/support/worldfiles/SR_50M/SR_50M.tfw +0 -6
- data/spec/support/worldfiles/SR_50M/SR_50M.tif +0 -0
- data/spec/unit/ext/error_symbols_spec.rb +0 -69
- data/spec/unit/ext/numeric_as_data_type_spec.rb +0 -115
- data/spec/unit/ffi/gdal_spec.rb +0 -73
- data/spec/unit/gdal/color_entry_spec.rb +0 -8
- data/spec/unit/gdal/color_interpretation_spec.rb +0 -8
- data/spec/unit/gdal/color_table_mixins/extensions_spec.rb +0 -62
- data/spec/unit/gdal/color_table_spec.rb +0 -146
- data/spec/unit/gdal/data_type_spec.rb +0 -74
- data/spec/unit/gdal/dataset_mixins/warp_methods_spec.rb +0 -55
- data/spec/unit/gdal/dataset_spec.rb +0 -148
- data/spec/unit/gdal/driver_mixins/extensions_spec.rb +0 -24
- data/spec/unit/gdal/driver_spec.rb +0 -51
- data/spec/unit/gdal/environment_methods_spec.rb +0 -8
- data/spec/unit/gdal/geo_transform_mixins/extensions_spec.rb +0 -69
- data/spec/unit/gdal/geo_transform_spec.rb +0 -265
- data/spec/unit/gdal/grid_spec.rb +0 -98
- data/spec/unit/gdal/gridder/point_extracting_spec.rb +0 -101
- data/spec/unit/gdal/gridder_options_spec.rb +0 -185
- data/spec/unit/gdal/gridder_spec.rb +0 -182
- data/spec/unit/gdal/internal_helpers_spec.rb +0 -278
- data/spec/unit/gdal/major_object_spec.rb +0 -10
- data/spec/unit/gdal/options_spec.rb +0 -33
- data/spec/unit/gdal/raster_attribute_table_spec.rb +0 -7
- data/spec/unit/gdal/raster_band_classifier_spec.rb +0 -260
- data/spec/unit/gdal/raster_band_mixins/extensions_spec.rb +0 -73
- data/spec/unit/gdal/raster_band_mixins/io_extensions_spec.rb +0 -135
- data/spec/unit/gdal/raster_band_spec.rb +0 -8
- data/spec/unit/gdal/rpc_info_spec.rb +0 -8
- data/spec/unit/gdal/version_info_spec.rb +0 -10
- data/spec/unit/gdal/virtual_dataset_spec.rb +0 -34
- data/spec/unit/gdal/warp_operation_spec.rb +0 -8
- data/spec/unit/gdal/warp_options_spec.rb +0 -338
- data/spec/unit/ogr/coordinate_transformation_spec.rb +0 -104
- data/spec/unit/ogr/data_source_mixins/capability_methods_spec.rb +0 -32
- data/spec/unit/ogr/data_source_spec.rb +0 -223
- data/spec/unit/ogr/driver_mixins/capability_methods_spec.rb +0 -20
- data/spec/unit/ogr/driver_spec.rb +0 -152
- data/spec/unit/ogr/envelope_spec.rb +0 -324
- data/spec/unit/ogr/feature_definition_spec.rb +0 -296
- data/spec/unit/ogr/feature_extensions_spec.rb +0 -90
- data/spec/unit/ogr/feature_spec.rb +0 -363
- data/spec/unit/ogr/field_definition_spec.rb +0 -118
- data/spec/unit/ogr/field_spec.rb +0 -195
- data/spec/unit/ogr/geometries/geometry_collection_25d_spec.rb +0 -25
- data/spec/unit/ogr/geometries/geometry_collection_spec.rb +0 -188
- data/spec/unit/ogr/geometries/line_string_25d_spec.rb +0 -25
- data/spec/unit/ogr/geometries/line_string_spec.rb +0 -107
- data/spec/unit/ogr/geometries/linear_ring_spec.rb +0 -92
- data/spec/unit/ogr/geometries/multi_line_string_25d_spec.rb +0 -25
- data/spec/unit/ogr/geometries/multi_line_string_spec.rb +0 -16
- data/spec/unit/ogr/geometries/multi_point_25d_spec.rb +0 -25
- data/spec/unit/ogr/geometries/multi_point_spec.rb +0 -16
- data/spec/unit/ogr/geometries/multi_polygon_25d_spec.rb +0 -25
- data/spec/unit/ogr/geometries/multi_polygon_spec.rb +0 -43
- data/spec/unit/ogr/geometries/none_geometry_spec.rb +0 -14
- data/spec/unit/ogr/geometries/point_25d_spec.rb +0 -25
- data/spec/unit/ogr/geometries/point_spec.rb +0 -307
- data/spec/unit/ogr/geometries/polygon_25d_spec.rb +0 -25
- data/spec/unit/ogr/geometries/polygon_spec.rb +0 -19
- data/spec/unit/ogr/geometries/unknown_geometry_spec.rb +0 -12
- data/spec/unit/ogr/geometry_field_definition_spec.rb +0 -73
- data/spec/unit/ogr/geometry_spec.rb +0 -711
- data/spec/unit/ogr/internal_helpers_spec.rb +0 -70
- data/spec/unit/ogr/layer_mixins/capability_methods_spec.rb +0 -90
- data/spec/unit/ogr/layer_mixins/ogr_feature_methods_spec.rb +0 -155
- data/spec/unit/ogr/layer_mixins/ogr_field_methods_spec.rb +0 -434
- data/spec/unit/ogr/layer_mixins/ogr_layer_method_methods_spec.rb +0 -22
- data/spec/unit/ogr/layer_mixins/ogr_query_filter_methods_spec.rb +0 -44
- data/spec/unit/ogr/layer_mixins/ogr_sql_methods_spec.rb +0 -14
- data/spec/unit/ogr/layer_spec.rb +0 -98
- data/spec/unit/ogr/spatial_reference_mixins/coordinate_system_getter_setters_spec.rb +0 -48
- data/spec/unit/ogr/spatial_reference_mixins/exporters_spec.rb +0 -151
- data/spec/unit/ogr/spatial_reference_mixins/importers_spec.rb +0 -40
- data/spec/unit/ogr/spatial_reference_mixins/morphers_spec.rb +0 -38
- data/spec/unit/ogr/spatial_reference_mixins/parameter_getter_setters_spec.rb +0 -105
- data/spec/unit/ogr/spatial_reference_mixins/type_checks_spec.rb +0 -159
- data/spec/unit/ogr/spatial_reference_spec.rb +0 -44
- data/spec/unit/ogr/style_table_spec.rb +0 -108
- data/spec/unit/ogr/style_tool_spec.rb +0 -159
- data/spec/unit/version_info_spec.rb +0 -50
@@ -17,7 +17,7 @@ module GDAL
|
|
17
17
|
# @param red_band [GDAL::RasterBand, FFI::Pointer]
|
18
18
|
# @param green_band [GDAL::RasterBand, FFI::Pointer]
|
19
19
|
# @param blue_band [GDAL::RasterBand, FFI::Pointer]
|
20
|
-
# @param colors [
|
20
|
+
# @param colors [Integer] Number of colors to return; 2-256.
|
21
21
|
# @param color_interpretation [FFI::GDAL::GDAL::PaletteInterp] The type
|
22
22
|
# of ColorTable to return.
|
23
23
|
# @param progress_function [Proc, FFI:GDAL::GDAL.ProgressFunc]
|
@@ -90,11 +90,11 @@ module GDAL
|
|
90
90
|
# of the raster data won't affect the checksum. Real and imaginary
|
91
91
|
# components of complex bands influence the result.
|
92
92
|
#
|
93
|
-
# @param x_offset [
|
94
|
-
# @param y_offset [
|
95
|
-
# @param x_size [
|
96
|
-
# @param y_size [
|
97
|
-
# @return [
|
93
|
+
# @param x_offset [Integer]
|
94
|
+
# @param y_offset [Integer]
|
95
|
+
# @param x_size [Integer]
|
96
|
+
# @param y_size [Integer]
|
97
|
+
# @return [Integer] The checksum value.
|
98
98
|
def checksum_image(x_offset, y_offset, x_size, y_size)
|
99
99
|
!!FFI::GDAL::Alg.GDALChecksumImage(
|
100
100
|
@c_pointer,
|
@@ -123,11 +123,11 @@ module GDAL
|
|
123
123
|
# from non-zero pixel values.
|
124
124
|
# @option options [String] distunits (PIXEL) Indicates what unit type to
|
125
125
|
# use for computing.
|
126
|
-
# @option options [
|
127
|
-
# @option options [
|
126
|
+
# @option options [Integer] maxdist The maximum distance to search.
|
127
|
+
# @option options [Integer] nodata If not given, it will try to use the
|
128
128
|
# nodata value on the +proximity_band+. If not found there, will use
|
129
129
|
# 65535.
|
130
|
-
# @option options [
|
130
|
+
# @option options [Integer] fixed_buf_val If set, all pixels within the
|
131
131
|
# +maxdist+ threshold are set to this fixed value instead of to a
|
132
132
|
# proximity distance.
|
133
133
|
def compute_proximity!(proximity_band, progress_function: nil, progress_arg: nil, **options)
|
@@ -164,7 +164,7 @@ module GDAL
|
|
164
164
|
# be interpolated (it does so using 0-valued pixels).
|
165
165
|
# @param max_search_distance [Float] Max number of pixels to search in all
|
166
166
|
# directions to find values to interpolate from.
|
167
|
-
# @param smoothing_iterations [
|
167
|
+
# @param smoothing_iterations [Integer] The number of 3x3 smoothing filter
|
168
168
|
# passes to run. Can be 0.
|
169
169
|
# @param progress_function [Proc, FFI:GDAL::GDAL.ProgressFunc]
|
170
170
|
# @param progress_arg [FFI::Pointer] Usually used when when using a
|
@@ -177,13 +177,13 @@ module GDAL
|
|
177
177
|
options_ptr = GDAL::Options.pointer(options)
|
178
178
|
|
179
179
|
!!FFI::GDAL::Alg.GDALFillNodata(@c_pointer,
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
180
|
+
mask_band_ptr,
|
181
|
+
max_search_distance,
|
182
|
+
0, # deprecated option in GDAL
|
183
|
+
smoothing_iterations,
|
184
|
+
options_ptr,
|
185
|
+
progress_function,
|
186
|
+
progress_arg)
|
187
187
|
end
|
188
188
|
|
189
189
|
# Creates vector polygons for all connected regions of pixels in the raster
|
@@ -211,7 +211,7 @@ module GDAL
|
|
211
211
|
# @param mask_band [GDAL::RasterBand, FFI::Pointer] Optional band, where all
|
212
212
|
# pixels in the mask with a value other than zero will be considered
|
213
213
|
# suitable for collection as polygons.
|
214
|
-
# @param pixel_value_field [
|
214
|
+
# @param pixel_value_field [Integer] Index of the feature attribute into
|
215
215
|
# which the pixel value of the polygon should be written.
|
216
216
|
# @param use_integer_function [Boolean] Indicates using GDAL's
|
217
217
|
# GDALPolygonize() instead of GDALFPolygonize(); the former uses a
|
@@ -219,7 +219,7 @@ module GDAL
|
|
219
219
|
# 32-bit float buffer. The integer based function is faster but less
|
220
220
|
# precise.
|
221
221
|
# @param options [Hash]
|
222
|
-
# @option options [
|
222
|
+
# @option options [Integer] '8CONNECTED' (4) Set to 8 to use 8
|
223
223
|
# connectedness.
|
224
224
|
# @param progress_function [Proc, FFI:GDAL::GDAL.ProgressFunc]
|
225
225
|
# @param progress_arg [FFI::Pointer] Usually used when when using a
|
@@ -227,9 +227,10 @@ module GDAL
|
|
227
227
|
# @return [OGR::Layer]
|
228
228
|
def polygonize(layer, mask_band: nil, pixel_value_field: -1, use_integer_function: false, progress_function: nil,
|
229
229
|
progress_arg: nil, **options)
|
230
|
-
mask_band_ptr = GDAL._pointer(GDAL::RasterBand, mask_band, false)
|
230
|
+
mask_band_ptr = GDAL._pointer(GDAL::RasterBand, mask_band, warn_on_nil: false)
|
231
231
|
layer_ptr = GDAL._pointer(OGR::Layer, layer)
|
232
232
|
raise OGR::InvalidLayer, "Invalid layer: #{layer.inspect}" if layer_ptr.null?
|
233
|
+
|
233
234
|
log "Pixel value field: #{pixel_value_field}"
|
234
235
|
|
235
236
|
options_ptr = GDAL::Options.pointer(options)
|
@@ -258,9 +259,9 @@ module GDAL
|
|
258
259
|
# If +mask_band+ is given, "nodata" pixels in the band will not be treated
|
259
260
|
# as part of a polygon, regardless of their pixel values.
|
260
261
|
#
|
261
|
-
# @param size_threshold [
|
262
|
+
# @param size_threshold [Integer] Polygons found in the raster with sizes
|
262
263
|
# smaller than this will be merged into their largest neighbor.
|
263
|
-
# @param connectedness [
|
264
|
+
# @param connectedness [Integer] 4 or 8. 4 indicates that diagonal pixels
|
264
265
|
# are not considered directly adjacent for polygon membership purposes;
|
265
266
|
# 8 indicates they are.
|
266
267
|
# @param mask_band [GDAL::RasterBand] [description] All pixels in this
|
@@ -299,9 +300,9 @@ module GDAL
|
|
299
300
|
|
300
301
|
private
|
301
302
|
|
302
|
-
# @param size_threshold [
|
303
|
+
# @param size_threshold [Integer] Polygons found in the raster with sizes
|
303
304
|
# smaller than this will be merged into their largest neighbor.
|
304
|
-
# @param connectedness [
|
305
|
+
# @param connectedness [Integer] 4 or 8. 4 indicates that diagonal pixels
|
305
306
|
# are not considered directly adjacent for polygon membership purposes;
|
306
307
|
# 8 indicates they are.
|
307
308
|
# @param mask_band [GDAL::RasterBand] [description] All pixels in this
|
@@ -313,7 +314,7 @@ module GDAL
|
|
313
314
|
# @param options [Hash] None supported in GDAL as of this writing.
|
314
315
|
def _sieve_filter(size_threshold, connectedness, destination_band, mask_band: nil, progress_function: nil,
|
315
316
|
progress_arg: nil, **options)
|
316
|
-
mask_band_ptr = GDAL._pointer(GDAL::RasterBand, mask_band, false)
|
317
|
+
mask_band_ptr = GDAL._pointer(GDAL::RasterBand, mask_band, warn_on_nil: false)
|
317
318
|
destination_band_ptr = GDAL._pointer(GDAL::RasterBand, destination_band)
|
318
319
|
|
319
320
|
if destination_band.nil? || destination_band.null?
|
data/lib/gdal/rpc_info.rb
CHANGED
@@ -14,9 +14,10 @@ module GDAL
|
|
14
14
|
|
15
15
|
# @param struct_or_ptr [FFI::GDAL::RPCInfo, FFI::Pointer]
|
16
16
|
def initialize(struct_or_ptr = nil)
|
17
|
-
@c_struct =
|
17
|
+
@c_struct = case struct_or_ptr
|
18
|
+
when FFI::GDAL::RPCInfo
|
18
19
|
struct_or_ptr
|
19
|
-
|
20
|
+
when FFI::Pointer
|
20
21
|
FFI::GDAL::RPCInfo.new(struct_or_ptr)
|
21
22
|
else
|
22
23
|
FFI::GDAL::RPCInfo.new
|
@@ -8,6 +8,14 @@ module GDAL
|
|
8
8
|
FFI::GDAL::Alg::ApproxTransform
|
9
9
|
end
|
10
10
|
|
11
|
+
# @param pointer [FFI::Pointer]
|
12
|
+
def self.release(pointer)
|
13
|
+
return unless pointer && !pointer.null?
|
14
|
+
|
15
|
+
FFI::GDAL::Alg.GDALDestroyApproxTransformer(pointer)
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [FFI::Pointer]
|
11
19
|
attr_reader :c_pointer
|
12
20
|
|
13
21
|
# @param base_transformer [GDAL::Transformer]
|
@@ -17,17 +25,18 @@ module GDAL
|
|
17
25
|
base_transformer_function = base_transformer.function
|
18
26
|
transformer_arg_ptr = base_transformer.c_pointer
|
19
27
|
|
20
|
-
|
28
|
+
pointer = FFI::GDAL::Alg.GDALCreateApproxTransformer(
|
21
29
|
base_transformer_function,
|
22
30
|
transformer_arg_ptr,
|
23
31
|
max_error
|
24
32
|
)
|
33
|
+
|
34
|
+
@c_pointer = FFI::AutoPointer.new(pointer, ApproximateTransformer.method(:destroy))
|
25
35
|
end
|
26
36
|
|
27
37
|
def destroy!
|
28
|
-
|
38
|
+
ApproximateTransformer.destroy(@c_pointer)
|
29
39
|
|
30
|
-
FFI::GDAL::Alg.GDALDestroyApproxTransformer(@c_pointer)
|
31
40
|
@c_pointer = nil
|
32
41
|
end
|
33
42
|
|
@@ -8,12 +8,19 @@ module GDAL
|
|
8
8
|
FFI::GDAL::Alg::GenImgProjTransform
|
9
9
|
end
|
10
10
|
|
11
|
+
# @param pointer [FFI::Pointer]
|
12
|
+
def self.release(pointer)
|
13
|
+
return unless pointer && !pointer.null?
|
14
|
+
|
15
|
+
FFI::GDAL::Alg.GDALDestroyGenImgProjTransformer(pointer)
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [FFI::Pointer]
|
11
19
|
attr_reader :c_pointer
|
12
20
|
|
13
21
|
def destroy!
|
14
|
-
|
22
|
+
BaseGeneralImageProjectionTransformer.release(@c_pointer)
|
15
23
|
|
16
|
-
FFI::GDAL::Alg.GDALDestroyGenImgProjTransformer(@c_pointer)
|
17
24
|
@c_pointer = nil
|
18
25
|
end
|
19
26
|
|
@@ -37,6 +44,12 @@ module GDAL
|
|
37
44
|
@c_pointer, geo_transform_ptr
|
38
45
|
)
|
39
46
|
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def init_pointer(pointer)
|
51
|
+
@c_pointer = FFI::AutoPointer.new(pointer, BaseGeneralImageProjectionTransformer.method(:release))
|
52
|
+
end
|
40
53
|
end
|
41
54
|
end
|
42
55
|
end
|
@@ -8,13 +8,20 @@ module GDAL
|
|
8
8
|
FFI::GDAL::Alg::GCPTransform
|
9
9
|
end
|
10
10
|
|
11
|
+
# @param pointer [FFI::Pointer]
|
12
|
+
def self.release(pointer)
|
13
|
+
return unless pointer && !pointer.null?
|
14
|
+
|
15
|
+
FFI::GDAL::Alg.GDALDestroyGCPTransformer(pointer)
|
16
|
+
end
|
17
|
+
|
11
18
|
# @return [FFI::Pointer] C pointer to the GCP transformer.
|
12
19
|
attr_reader :c_pointer
|
13
20
|
|
14
21
|
# @param gcp_list [Array<FFI::GDAL::GCP>]
|
15
|
-
# @param requested_polynomial_order [
|
22
|
+
# @param requested_polynomial_order [Integer] 1, 2, or 3.
|
16
23
|
# @param reversed [Boolean]
|
17
|
-
def initialize(gcp_list, requested_polynomial_order, reversed
|
24
|
+
def initialize(gcp_list, requested_polynomial_order, reversed: false, tolerance: nil, minimum_gcps: nil)
|
18
25
|
gcp_list_ptr = FFI::MemoryPointer.new(:pointer, gcp_list.size)
|
19
26
|
|
20
27
|
# TODO: fasterer: each_with_index is slower than loop
|
@@ -22,27 +29,28 @@ module GDAL
|
|
22
29
|
gcp_list_ptr[i].put_pointer(0, gcp.to_ptr)
|
23
30
|
end
|
24
31
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
32
|
+
pointer = if tolerance || minimum_gcps
|
33
|
+
FFI::GDAL::Alg.GDALCreateGCPRefineTransformer(
|
34
|
+
gcp_list.size,
|
35
|
+
gcp_list_ptr,
|
36
|
+
requested_polynomial_order,
|
37
|
+
reversed
|
38
|
+
)
|
39
|
+
else
|
40
|
+
FFI::GDAL::Alg.GDALCreateGCPTransformer(
|
41
|
+
gcp_list.size,
|
42
|
+
gcp_list_ptr,
|
43
|
+
requested_polynomial_order,
|
44
|
+
reversed
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
@c_pointer = FFI::AutoPointer.new(pointer, GCPTransformer.method(:release))
|
40
49
|
end
|
41
50
|
|
42
51
|
def destroy!
|
43
|
-
|
52
|
+
GCPTransformer.release(@c_pointer)
|
44
53
|
|
45
|
-
FFI::GDAL::Alg.GDALDestroyGCPTransformer(@c_pointer)
|
46
54
|
@c_pointer = nil
|
47
55
|
end
|
48
56
|
|
@@ -10,13 +10,15 @@ module GDAL
|
|
10
10
|
# @param source_wkt [String]
|
11
11
|
# @param destination_wkt [String]
|
12
12
|
# @param gcp_use_ok [Boolean]
|
13
|
-
# @param order [
|
13
|
+
# @param order [Integer]
|
14
14
|
def initialize(source_dataset, destination_dataset: nil, source_wkt: nil, destination_wkt: nil,
|
15
15
|
gcp_use_ok: false, order: 0)
|
16
|
-
|
17
|
-
|
16
|
+
super()
|
17
|
+
|
18
|
+
source_ptr = GDAL::Dataset.new_pointer(source_dataset)
|
19
|
+
dest_ptr = GDAL::Dataset.new_pointer(destination_dataset, warn_on_nil: false)
|
18
20
|
|
19
|
-
|
21
|
+
pointer = FFI::GDAL::Alg.GDALCreateGenImgProjTransformer(
|
20
22
|
source_ptr,
|
21
23
|
source_wkt,
|
22
24
|
dest_ptr,
|
@@ -25,9 +27,9 @@ module GDAL
|
|
25
27
|
0.0,
|
26
28
|
order
|
27
29
|
)
|
28
|
-
raise if
|
30
|
+
raise if pointer.null?
|
29
31
|
|
30
|
-
|
32
|
+
init_pointer(pointer)
|
31
33
|
end
|
32
34
|
end
|
33
35
|
end
|
@@ -15,11 +15,11 @@ module GDAL
|
|
15
15
|
# @option options [String] dst_srs Use to override +destination_dataset+'s WKT
|
16
16
|
# SRS.
|
17
17
|
# @option options [Boolean] gcps_ok (true)
|
18
|
-
# @option options [
|
18
|
+
# @option options [Integer] refine_minimum_gcps Minimum amount of GCPs that
|
19
19
|
# should be available after the refinement.
|
20
20
|
# @option options [Float] refine_tolerance The tolerance that specifies
|
21
21
|
# when a GCP will be eliminated.
|
22
|
-
# @option options [
|
22
|
+
# @option options [Integer] max_gcp_order Max order to use for GCP-derived
|
23
23
|
# polynomials, if possible. Default is to auto-select based on the number
|
24
24
|
# of GCPs. A value of -1 triggers use of Thin Plate Spline instead of
|
25
25
|
# polynomials.
|
@@ -38,17 +38,20 @@ module GDAL
|
|
38
38
|
# up a CENTER_LONG value on the coordinate system to rewrap things around
|
39
39
|
# the center of the image.
|
40
40
|
def initialize(source_dataset, destination_dataset: nil, **options)
|
41
|
-
|
42
|
-
|
41
|
+
super()
|
42
|
+
|
43
|
+
source_ptr = GDAL::Dataset.new_pointer(source_dataset)
|
44
|
+
destination_ptr = GDAL::Dataset.new_pointer(destination_dataset, warn_on_nil: false)
|
43
45
|
options_ptr = GDAL::Options.pointer(options)
|
44
46
|
|
45
|
-
|
47
|
+
pointer = FFI::GDAL::Alg.GDALCreateGenImgProjTransformer2(
|
46
48
|
source_ptr,
|
47
49
|
destination_ptr,
|
48
50
|
options_ptr
|
49
51
|
)
|
52
|
+
raise if pointer.null?
|
50
53
|
|
51
|
-
|
54
|
+
init_pointer(pointer)
|
52
55
|
end
|
53
56
|
end
|
54
57
|
end
|
@@ -11,17 +11,21 @@ module GDAL
|
|
11
11
|
# @param destination_geo_transform [GDAL::GeoTransform, FFI::Pointer]
|
12
12
|
# @return [FFI::Pointer]
|
13
13
|
def initialize(source_wkt, source_geo_transform, destination_wkt, destination_geo_transform)
|
14
|
+
super()
|
15
|
+
|
14
16
|
source_ptr = GDAL._pointer(GDAL::GeoTransform, source_geo_transform)
|
15
17
|
destination_ptr = GDAL._pointer(GDAL::GeoTransform, destination_geo_transform)
|
16
18
|
|
17
|
-
|
19
|
+
pointer = FFI::GDAL::Alg.GDALCreateGenImgProjTransformer3(
|
18
20
|
source_wkt,
|
19
21
|
source_ptr,
|
20
22
|
destination_wkt,
|
21
23
|
destination_ptr
|
22
24
|
)
|
23
25
|
|
24
|
-
|
26
|
+
raise if pointer.null?
|
27
|
+
|
28
|
+
init_pointer(pointer)
|
25
29
|
end
|
26
30
|
end
|
27
31
|
end
|
@@ -8,27 +8,35 @@ module GDAL
|
|
8
8
|
FFI::GDAL::Alg::GeoLocTransform
|
9
9
|
end
|
10
10
|
|
11
|
+
# @param pointer [FFI::Pointer]
|
12
|
+
def self.release(pointer)
|
13
|
+
return unless pointer && !pointer.null?
|
14
|
+
|
15
|
+
FFI::GDAL::Alg.GDALDestroyGeoLocTransformer(pointer)
|
16
|
+
end
|
17
|
+
|
11
18
|
# @return [FFI::Pointer] C pointer to the C geolocation transformer.
|
12
19
|
attr_reader :c_pointer
|
13
20
|
|
14
21
|
# @param base_dataset [GDAL::Dataset]
|
15
22
|
# @param geolocation_info [Array<String>]
|
16
23
|
# @param reversed [Boolean]
|
17
|
-
def intialize(base_dataset, geolocation_info, reversed
|
24
|
+
def intialize(base_dataset, geolocation_info, reversed: false)
|
18
25
|
base_dataset_ptr = GDAL._pointer(GDAL::Dataset, base_dataset)
|
19
26
|
geolocation_info_ptr = GDAL._string_array_to_pointer(geolocation_info)
|
20
27
|
|
21
|
-
|
28
|
+
pointer = FFI::GDAL::Alg.CreateGeoLocTransformer(
|
22
29
|
base_dataset_ptr,
|
23
30
|
geolocation_info_ptr,
|
24
31
|
reversed
|
25
32
|
)
|
33
|
+
|
34
|
+
@c_pointer = FFI::AutoPointer.new(pointer, GeolocationTransformer.method(:release))
|
26
35
|
end
|
27
36
|
|
28
37
|
def destroy!
|
29
|
-
|
38
|
+
GeolocationTransformer.release(@c_pointer)
|
30
39
|
|
31
|
-
FFI::GDAL::Alg.GDALDestroyGeoLocTransformer(@c_pointer)
|
32
40
|
@c_pointer = nil
|
33
41
|
end
|
34
42
|
|
@@ -8,19 +8,27 @@ module GDAL
|
|
8
8
|
FFI::GDAL::Alg::ReprojectionTransform
|
9
9
|
end
|
10
10
|
|
11
|
+
# @param pointer [FFI::Pointer]
|
12
|
+
def self.release(pointer)
|
13
|
+
return unless pointer && !pointer.null?
|
14
|
+
|
15
|
+
FFI::GDAL::Alg.GDALDestroyReprojectionTransformer(pointer)
|
16
|
+
end
|
17
|
+
|
11
18
|
# @return [FFI::Pointer] C pointer to the C reprojection transformer.
|
12
19
|
attr_reader :c_pointer
|
13
20
|
|
14
21
|
# @param source_wkt [String]
|
15
22
|
# @param destination_wkt [String]
|
16
23
|
def initialize(source_wkt, destination_wkt)
|
17
|
-
|
24
|
+
pointer = FFI::GDAL::Alg.GDALCreateReprojectionTransformer(source_wkt, destination_wkt)
|
25
|
+
|
26
|
+
@c_pointer = FFI::AutoPointer.new(pointer, ReprojectionTransformer.method(:release))
|
18
27
|
end
|
19
28
|
|
20
29
|
def destroy!
|
21
|
-
|
30
|
+
ReprojectionTransformer.release(@c_pointer)
|
22
31
|
|
23
|
-
FFI::GDAL::Alg.GDALDestroyReprojectionTransformer(@c_pointer)
|
24
32
|
@c_pointer = nil
|
25
33
|
end
|
26
34
|
|
@@ -8,6 +8,13 @@ module GDAL
|
|
8
8
|
FFI::GDAL::Alg::RPCTransform
|
9
9
|
end
|
10
10
|
|
11
|
+
# @param pointer [FFI::Pointer]
|
12
|
+
def self.release(pointer)
|
13
|
+
return unless pointer && !pointer.null?
|
14
|
+
|
15
|
+
FFI::GDAL::Alg.GDALDestroyRPCTransformer(pointer)
|
16
|
+
end
|
17
|
+
|
11
18
|
# @return [FFI::Pointer] C pointer to the C RPC transformer.
|
12
19
|
attr_reader :c_pointer
|
13
20
|
|
@@ -28,15 +35,17 @@ module GDAL
|
|
28
35
|
# @option options [Number] rpc_dem_missing_value Value of DEM height that
|
29
36
|
# must be unsed in case the DEM has a nodata value at the sampling point,
|
30
37
|
# or if its extent doesn't cover the requested coordinate.
|
31
|
-
def initialize(rpc_info, pixel_error_threshold, reversed
|
38
|
+
def initialize(rpc_info, pixel_error_threshold, reversed: false, **options)
|
32
39
|
options_ptr = GDAL::Options.pointer(options)
|
33
40
|
|
34
|
-
|
41
|
+
pointer = FFI::GDAL::Alg.GDALCreateRPCTransformer(
|
35
42
|
rpc_info,
|
36
43
|
reversed,
|
37
44
|
pixel_error_threshold,
|
38
45
|
options_ptr
|
39
46
|
)
|
47
|
+
|
48
|
+
@c_pointer = FFI::AutoPointer.new(pointer, RPCTransformer.method(:release))
|
40
49
|
end
|
41
50
|
|
42
51
|
def destroy!
|
@@ -8,12 +8,19 @@ module GDAL
|
|
8
8
|
FFI::GDAL::Alg::TPSTransform
|
9
9
|
end
|
10
10
|
|
11
|
+
# @param pointer [FFI::Pointer]
|
12
|
+
def self.release(pointer)
|
13
|
+
return unless pointer && !pointer.null?
|
14
|
+
|
15
|
+
FFI::GDAL::Alg.GDALDestroyTPSTransformer(pointer)
|
16
|
+
end
|
17
|
+
|
11
18
|
# @return [FFI::Pointer] C pointer to the C TPS transformer.
|
12
19
|
attr_reader :c_pointer
|
13
20
|
|
14
21
|
# @param gcp_list [Array<FFI::GDAL::GCP>]
|
15
22
|
# @param reversed [Boolean]
|
16
|
-
def initialize(gcp_list, reversed
|
23
|
+
def initialize(gcp_list, reversed: false)
|
17
24
|
gcp_list_ptr = FFI::MemoryPointer.new(:pointer, gcp_list.size)
|
18
25
|
|
19
26
|
# TODO: fasterer: each_with_index is slower than loop
|
@@ -21,13 +28,14 @@ module GDAL
|
|
21
28
|
gcp_list_ptr[i].put_pointer(0, gcp.to_ptr)
|
22
29
|
end
|
23
30
|
|
24
|
-
|
31
|
+
pointer = FFI::GDAL::Alg.GDALCreateTPSTransformer(gcp_list.size, gcp_list_ptr, reversed)
|
32
|
+
|
33
|
+
@c_pointer = FFI::AutoPointer.new(pointer, TPSTransformer.method(:release))
|
25
34
|
end
|
26
35
|
|
27
36
|
def destroy!
|
28
|
-
|
37
|
+
TPSTransformer.release(@c_pointer)
|
29
38
|
|
30
|
-
FFI::GDAL::Alg.GDALDestroyTPSTransformer(@c_pointer)
|
31
39
|
@c_pointer = nil
|
32
40
|
end
|
33
41
|
|
data/lib/gdal/version_info.rb
CHANGED
@@ -46,8 +46,8 @@ module GDAL
|
|
46
46
|
FFI::GDAL.GDALVersionInfo('--version')
|
47
47
|
end
|
48
48
|
|
49
|
-
# @param major [
|
50
|
-
# @param minor [
|
49
|
+
# @param major [Integer]
|
50
|
+
# @param minor [Integer]
|
51
51
|
# @return [Boolean] +true+ if the runtime GDAL library matches the given
|
52
52
|
# version params.
|
53
53
|
def check_version(major, minor)
|
data/lib/gdal/virtual_dataset.rb
CHANGED
@@ -41,6 +41,7 @@ module GDAL
|
|
41
41
|
FFI::GDAL::VRT.VRTAddSource(vrt_band, new_source)
|
42
42
|
end
|
43
43
|
|
44
|
+
# rubocop:disable Metrics/ParameterLists
|
44
45
|
# @return [Boolean]
|
45
46
|
def add_simple_source(vrt_band, source_band, no_data_value,
|
46
47
|
src_x_offset: 0, src_y_offset: 0, src_x_size: nil, src_y_size: nil,
|
@@ -83,6 +84,7 @@ module GDAL
|
|
83
84
|
no_data_value # dfNoDataValue
|
84
85
|
)
|
85
86
|
end
|
87
|
+
# rubocop:enable Metrics/ParameterLists
|
86
88
|
|
87
89
|
# @param vrt_band [FFI::Pointer]
|
88
90
|
# @param read_function [Proc]
|