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
data/lib/ogr/feature.rb
CHANGED
@@ -3,11 +3,15 @@
|
|
3
3
|
require 'date'
|
4
4
|
require_relative '../ogr'
|
5
5
|
require_relative '../gdal'
|
6
|
-
require_relative 'feature_extensions'
|
7
6
|
|
8
7
|
module OGR
|
9
8
|
class Feature
|
10
|
-
|
9
|
+
# @param pointer [FFI::Pointer]
|
10
|
+
def self.release(pointer)
|
11
|
+
return unless pointer && !pointer.null?
|
12
|
+
|
13
|
+
FFI::OGR::API.OGR_F_Destroy(pointer)
|
14
|
+
end
|
11
15
|
|
12
16
|
# @return [FFI::Pointer] C pointer of the C Feature.
|
13
17
|
attr_reader :c_pointer
|
@@ -16,27 +20,35 @@ module OGR
|
|
16
20
|
# a FeatureDefinition (i.e. normal Feature creation) or a Pointer (in the
|
17
21
|
# case a handle to a C OGR Feature needs to be wrapped with this object).
|
18
22
|
def initialize(fd_or_pointer)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
23
|
+
pointer = case fd_or_pointer
|
24
|
+
when OGR::FeatureDefinition then FFI::OGR::API.OGR_F_Create(fd_or_pointer.c_pointer)
|
25
|
+
when FFI::Pointer
|
26
|
+
fd_or_pointer.autorelease = false
|
27
|
+
fd_or_pointer
|
28
|
+
else
|
29
|
+
raise OGR::InvalidFeature, 'OGR::Feature must be instantiated with valid feature'
|
30
|
+
end
|
31
|
+
|
32
|
+
if !pointer.is_a?(FFI::Pointer) || pointer.null?
|
33
|
+
raise OGR::InvalidFeature, "Unable to create Feature with #{fd_or_pointer}"
|
34
|
+
end
|
24
35
|
|
25
|
-
|
36
|
+
# pointer.autorelease = false
|
26
37
|
|
27
|
-
|
38
|
+
# @c_pointer = FFI::AutoPointer.new(pointer, Feature.method(:release))
|
39
|
+
@c_pointer = pointer
|
28
40
|
end
|
29
41
|
|
30
42
|
def destroy!
|
31
|
-
|
43
|
+
Feature.release(@c_pointer)
|
32
44
|
|
33
|
-
FFI::OGR::API.OGR_F_Destroy(@c_pointer)
|
34
45
|
@c_pointer = nil
|
35
46
|
end
|
36
47
|
|
37
48
|
# @return [OGR::Feature]
|
38
49
|
# @raise [OGR::Failure] If, for some reason, the clone fails.
|
39
50
|
def clone
|
51
|
+
# This new feature is owned by the caller and must be released accordingly.
|
40
52
|
feature_ptr = FFI::OGR::API.OGR_F_Clone(@c_pointer)
|
41
53
|
raise OGR::Failure, 'Unable to clone feature' if feature_ptr.nil?
|
42
54
|
|
@@ -58,43 +70,44 @@ module OGR
|
|
58
70
|
# @param _other_feature [OGR::Feature]
|
59
71
|
# @param _be_forgiving [Boolean] +true+ if the operation should continue
|
60
72
|
# despite lacking output fields matching some of the source fields.
|
61
|
-
# @param with_map [Array<
|
73
|
+
# @param with_map [Array<Integer>]
|
74
|
+
# @raise [OGR::Failure]
|
62
75
|
# TODO: Implement +with_map+
|
63
|
-
def set_from!(_other_feature, _be_forgiving
|
76
|
+
def set_from!(_other_feature, _be_forgiving: false, with_map: nil)
|
64
77
|
raise NotImplementedError, 'with_map: is not yet supported' if with_map
|
65
78
|
|
66
|
-
|
67
|
-
|
68
|
-
|
79
|
+
OGR::ErrorHandling.handle_ogr_err('Unable to set from other feature') do
|
80
|
+
FFI::OGR::API.OGR_F_SetFrom(@c_pointer, other_feature_ptr)
|
81
|
+
end
|
69
82
|
end
|
70
83
|
|
71
84
|
# This will always be the same as the field count for the feature
|
72
85
|
# definition.
|
73
86
|
#
|
74
|
-
# @return [
|
87
|
+
# @return [Integer]
|
75
88
|
def field_count
|
76
89
|
FFI::OGR::API.OGR_F_GetFieldCount(@c_pointer)
|
77
90
|
end
|
78
91
|
|
79
|
-
# @param index [
|
92
|
+
# @param index [Integer]
|
80
93
|
# @param value [String]
|
81
94
|
def set_field_string(index, value)
|
82
95
|
FFI::OGR::API.OGR_F_SetFieldString(@c_pointer, index, value)
|
83
96
|
end
|
84
97
|
|
85
|
-
# @param index [
|
86
|
-
# @param value [
|
98
|
+
# @param index [Integer]
|
99
|
+
# @param value [Integer]
|
87
100
|
def set_field_integer(index, value)
|
88
101
|
FFI::OGR::API.OGR_F_SetFieldInteger(@c_pointer, index, value)
|
89
102
|
end
|
90
103
|
|
91
|
-
# @param index [
|
104
|
+
# @param index [Integer]
|
92
105
|
# @param value [Float]
|
93
106
|
def set_field_double(index, value)
|
94
107
|
FFI::OGR::API.OGR_F_SetFieldDouble(@c_pointer, index, value)
|
95
108
|
end
|
96
109
|
|
97
|
-
# @param index [
|
110
|
+
# @param index [Integer]
|
98
111
|
# @param values [Array<String>]
|
99
112
|
# @raise [GDAL::Error] If index isn't valid
|
100
113
|
def set_field_string_list(index, values)
|
@@ -107,8 +120,8 @@ module OGR
|
|
107
120
|
)
|
108
121
|
end
|
109
122
|
|
110
|
-
# @param index [
|
111
|
-
# @param values [Array<
|
123
|
+
# @param index [Integer]
|
124
|
+
# @param values [Array<Integer>]
|
112
125
|
def set_field_integer_list(index, values)
|
113
126
|
values_ptr = FFI::MemoryPointer.new(:int, values.size)
|
114
127
|
values_ptr.write_array_of_int(values)
|
@@ -121,7 +134,7 @@ module OGR
|
|
121
134
|
)
|
122
135
|
end
|
123
136
|
|
124
|
-
# @param index [
|
137
|
+
# @param index [Integer]
|
125
138
|
# @param values [Array<Float>]
|
126
139
|
def set_field_double_list(index, values)
|
127
140
|
values_ptr = FFI::MemoryPointer.new(:double, values.size)
|
@@ -135,7 +148,7 @@ module OGR
|
|
135
148
|
)
|
136
149
|
end
|
137
150
|
|
138
|
-
# @param index [
|
151
|
+
# @param index [Integer]
|
139
152
|
# @param field [OGR::Field]
|
140
153
|
def set_field_raw(index, field)
|
141
154
|
usable_raw_field = field.c_struct
|
@@ -143,7 +156,7 @@ module OGR
|
|
143
156
|
FFI::OGR::API.OGR_F_SetFieldRaw(@c_pointer, index, usable_raw_field)
|
144
157
|
end
|
145
158
|
|
146
|
-
# @param index [
|
159
|
+
# @param index [Integer]
|
147
160
|
# @param value [String]
|
148
161
|
def set_field_binary(index, value)
|
149
162
|
raise TypeError, 'value must be a binary string' unless value.is_a? String
|
@@ -159,46 +172,51 @@ module OGR
|
|
159
172
|
)
|
160
173
|
end
|
161
174
|
|
162
|
-
# @param index [
|
175
|
+
# @param index [Integer]
|
163
176
|
# @param value [Date, Time, DateTime]
|
164
177
|
def set_field_date_time(index, value)
|
165
178
|
time = value.to_time
|
166
179
|
zone = OGR._format_time_zone_for_ogr(value.zone)
|
167
180
|
|
168
181
|
FFI::OGR::API.OGR_F_SetFieldDateTime(@c_pointer, index,
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
182
|
+
time.year,
|
183
|
+
time.month,
|
184
|
+
time.day,
|
185
|
+
time.hour,
|
186
|
+
time.min,
|
187
|
+
time.sec,
|
188
|
+
zone)
|
176
189
|
end
|
177
190
|
|
178
|
-
#
|
191
|
+
# NOTE: Do not modify the FieldDefinition that's returned here.
|
192
|
+
#
|
193
|
+
# @param index [Integer]
|
179
194
|
# @return [OGR::FieldDefinition]
|
180
195
|
def field_definition(index)
|
196
|
+
# This returns an internal reference and should not be deleted or modified
|
181
197
|
field_pointer = FFI::OGR::API.OGR_F_GetFieldDefnRef(@c_pointer, index)
|
198
|
+
field_pointer.autorelease = false
|
199
|
+
|
182
200
|
return nil if field_pointer.null?
|
183
201
|
|
184
202
|
OGR::FieldDefinition.new(field_pointer, nil)
|
185
203
|
end
|
186
204
|
|
187
205
|
# @param name [String]
|
188
|
-
# @return [
|
206
|
+
# @return [Integer, nil]
|
189
207
|
def field_index(name)
|
190
208
|
result = FFI::OGR::API.OGR_F_GetFieldIndex(@c_pointer, name)
|
191
209
|
|
192
|
-
result
|
210
|
+
result.negative? ? nil : result
|
193
211
|
end
|
194
212
|
|
195
|
-
# @param index [
|
213
|
+
# @param index [Integer]
|
196
214
|
# @return [Boolean]
|
197
215
|
def field_set?(index)
|
198
216
|
FFI::OGR::API.OGR_F_IsFieldSet(@c_pointer, index)
|
199
217
|
end
|
200
218
|
|
201
|
-
# @param index [
|
219
|
+
# @param index [Integer]
|
202
220
|
def unset_field(index)
|
203
221
|
FFI::OGR::API.OGR_F_UnsetField(@c_pointer, index)
|
204
222
|
end
|
@@ -206,62 +224,91 @@ module OGR
|
|
206
224
|
# @return [OGR::FeatureDefinition,nil]
|
207
225
|
def definition
|
208
226
|
feature_defn_ptr = FFI::OGR::API.OGR_F_GetDefnRef(@c_pointer)
|
227
|
+
feature_defn_ptr.autorelease = false
|
228
|
+
|
209
229
|
return nil if feature_defn_ptr.null?
|
210
230
|
|
211
231
|
OGR::FeatureDefinition.new(feature_defn_ptr)
|
212
232
|
end
|
213
233
|
|
234
|
+
# NOTE: Do not modify the Geometry that's returned here.
|
235
|
+
#
|
214
236
|
# @return [OGR::Geometry]
|
215
237
|
def geometry
|
238
|
+
# This returns an internal reference and should not be deleted or modified
|
216
239
|
geometry_ptr = FFI::OGR::API.OGR_F_GetGeometryRef(@c_pointer)
|
240
|
+
geometry_ptr.autorelease = false
|
241
|
+
|
217
242
|
return nil if geometry_ptr.null?
|
218
243
|
|
219
244
|
OGR::Geometry.factory(geometry_ptr)
|
220
245
|
end
|
221
246
|
|
247
|
+
# Sets the geometry of the feature by making a copy of +new_geometry+.
|
248
|
+
#
|
249
|
+
# @param new_geometry [OGR::Geometry]
|
250
|
+
# @raise [OGR::Failure]
|
251
|
+
def set_geometry(new_geometry) # rubocop:disable Naming/AccessorMethodName
|
252
|
+
OGR::ErrorHandling.handle_ogr_err('Unable to set geometry on feature') do
|
253
|
+
FFI::OGR::API.OGR_F_SetGeometry(@c_pointer, new_geometry.c_pointer)
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
# Sets the geometry of the feature by taking ownership of +new_geometry.
|
258
|
+
#
|
222
259
|
# @param new_geometry [OGR::Geometry]
|
223
|
-
# @
|
224
|
-
def
|
225
|
-
|
260
|
+
# @raise [OGR::Failure]
|
261
|
+
def set_geometry_directly(new_geometry) # rubocop:disable Naming/AccessorMethodName
|
262
|
+
new_geometry.c_pointer.autorelease = false
|
226
263
|
|
227
|
-
|
264
|
+
OGR::ErrorHandling.handle_ogr_err('Unable to set geometry directly on feature') do
|
265
|
+
FFI::OGR::API.OGR_F_SetGeometryDirectly(@c_pointer, new_geometry.c_pointer)
|
266
|
+
end
|
228
267
|
end
|
268
|
+
alias geometry= set_geometry_directly
|
229
269
|
|
270
|
+
# Takes away ownership of the Feature's Geometry and returns it to the caller.
|
271
|
+
#
|
230
272
|
# @return [OGR::Geometry]
|
231
273
|
def steal_geometry
|
232
274
|
geometry_ptr = FFI::OGR::API.OGR_F_StealGeometry(@c_pointer)
|
233
|
-
raise OGR::Failure, 'Unable to steal geometry.' if geometry_ptr.nil?
|
275
|
+
raise OGR::Failure, 'Unable to steal geometry.' if geometry_ptr.nil? || geometry_ptr.null?
|
234
276
|
|
235
277
|
OGR::Geometry.factory(geometry_ptr)
|
236
278
|
end
|
237
279
|
|
238
|
-
# @return [
|
280
|
+
# @return [Integer]
|
239
281
|
def fid
|
240
282
|
FFI::OGR::API.OGR_F_GetFID(@c_pointer)
|
241
283
|
end
|
242
284
|
|
243
|
-
# @param new_fid [
|
244
|
-
# @
|
285
|
+
# @param new_fid [Integer]
|
286
|
+
# @raise [OGR::Failure]
|
245
287
|
def fid=(new_fid)
|
246
|
-
|
247
|
-
|
248
|
-
|
288
|
+
OGR::ErrorHandling.handle_ogr_err('Unable to set FID') do
|
289
|
+
FFI::OGR::API.OGR_F_SetFID(@c_pointer, new_fid)
|
290
|
+
end
|
249
291
|
end
|
250
292
|
|
251
293
|
# The number of Geometries in this feature.
|
252
294
|
#
|
253
|
-
# @return [
|
295
|
+
# @return [Integer]
|
254
296
|
def geometry_field_count
|
255
297
|
FFI::OGR::API.OGR_F_GetGeomFieldCount(@c_pointer)
|
256
298
|
end
|
257
299
|
|
258
|
-
#
|
300
|
+
# NOTE: Do not modify the GeometryFieldDefinition that's returned here.
|
301
|
+
#
|
302
|
+
# @param index [Integer]
|
259
303
|
# @return [OGR::GeometryFieldDefinition] A read-only
|
260
304
|
# OGR::GeometryFieldDefinition.
|
261
305
|
# @raise [OGR::InvalidGeometryFieldDefinition] If there isn't one at
|
262
306
|
# +index+.
|
263
307
|
def geometry_field_definition(index)
|
308
|
+
# This returns an internal reference and should not be deleted or modified
|
264
309
|
gfd_ptr = FFI::OGR::API.OGR_F_GetGeomFieldDefnRef(@c_pointer, index)
|
310
|
+
gfd_ptr.autorelease = false
|
311
|
+
|
265
312
|
return nil if gfd_ptr.nil?
|
266
313
|
|
267
314
|
gfd = OGR::GeometryFieldDefinition.new(gfd_ptr)
|
@@ -271,29 +318,54 @@ module OGR
|
|
271
318
|
end
|
272
319
|
|
273
320
|
# @param name [String]
|
274
|
-
# @return [
|
321
|
+
# @return [Integer]
|
275
322
|
def geometry_field_index(name)
|
276
323
|
FFI::OGR::API.OGR_F_GetGeomFieldIndex(@c_pointer, name)
|
277
324
|
end
|
278
325
|
|
279
|
-
#
|
326
|
+
# NOTE: Do not modify the Geometry that's returned here.
|
327
|
+
#
|
328
|
+
# @param index [Integer]
|
280
329
|
# @return [OGR::Geometry, nil] A read-only OGR::Geometry.
|
281
330
|
def geometry_field(index)
|
331
|
+
# This returns an internal reference and should not be deleted or modified
|
282
332
|
geometry_ptr = FFI::OGR::API.OGR_F_GetGeomFieldRef(@c_pointer, index)
|
333
|
+
geometry_ptr.autorelease = false
|
334
|
+
|
283
335
|
return nil if geometry_ptr.nil? || geometry_ptr.null?
|
284
336
|
|
285
337
|
OGR::Geometry.factory(geometry_ptr)
|
286
338
|
end
|
287
339
|
|
288
|
-
#
|
340
|
+
# Sets the feature geometry of a specified geometry field by making a copy
|
341
|
+
# of +geometry+.
|
342
|
+
#
|
343
|
+
# @param index [Integer]
|
289
344
|
# @param geometry [OGR::Geometry]
|
345
|
+
# @raise [OGR::Failure]
|
290
346
|
def set_geometry_field(index, geometry)
|
291
347
|
geometry_ptr = GDAL._pointer(OGR::Geometry, geometry)
|
292
348
|
raise OGR::InvalidGeometry if geometry_ptr.nil?
|
293
349
|
|
294
|
-
|
350
|
+
OGR::ErrorHandling.handle_ogr_err("Unable to set geometry field at index #{index}") do
|
351
|
+
FFI::OGR::API.OGR_F_SetGeomField(@c_pointer, index, geometry_ptr)
|
352
|
+
end
|
353
|
+
end
|
295
354
|
|
296
|
-
|
355
|
+
# Sets the feature geometry of a specified geometry field by taking ownership
|
356
|
+
# of +geometry+.
|
357
|
+
#
|
358
|
+
# @param index [Integer]
|
359
|
+
# @param geometry [OGR::Geometry]
|
360
|
+
# @raise [OGR::Failure]
|
361
|
+
def set_geometry_field_directly(index, geometry)
|
362
|
+
geometry_ptr = GDAL._pointer(OGR::Geometry, geometry, autorelease: false)
|
363
|
+
|
364
|
+
raise OGR::InvalidGeometry if geometry_ptr.nil?
|
365
|
+
|
366
|
+
OGR::ErrorHandling.handle_ogr_err("Unable to set geometry field directly at index #{index}") do
|
367
|
+
FFI::OGR::API.OGR_F_SetGeomFieldDirectly(@c_pointer, index, geometry_ptr)
|
368
|
+
end
|
297
369
|
end
|
298
370
|
|
299
371
|
# @return [Boolean]
|
@@ -302,68 +374,76 @@ module OGR
|
|
302
374
|
end
|
303
375
|
alias equals? equal?
|
304
376
|
|
305
|
-
# @param index [
|
306
|
-
# @return [
|
377
|
+
# @param index [Integer]
|
378
|
+
# @return [Integer]
|
307
379
|
def field_as_integer(index)
|
308
380
|
FFI::OGR::API.OGR_F_GetFieldAsInteger(@c_pointer, index)
|
309
381
|
end
|
310
382
|
|
311
|
-
# @param index [
|
312
|
-
# @return [Array<
|
383
|
+
# @param index [Integer]
|
384
|
+
# @return [Array<Integer>]
|
313
385
|
def field_as_integer_list(index)
|
314
386
|
list_size_ptr = FFI::MemoryPointer.new(:int)
|
315
|
-
|
316
|
-
|
387
|
+
# This list is internal, and should not be modified, or freed. Its lifetime may be very brief.
|
388
|
+
list_ptr = FFI::OGR::API.OGR_F_GetFieldAsIntegerList(@c_pointer, index, list_size_ptr)
|
389
|
+
list_ptr.autorelease = false
|
390
|
+
|
317
391
|
return [] if list_ptr.null?
|
318
392
|
|
319
393
|
list_ptr.read_array_of_int(list_size_ptr.read_int)
|
320
394
|
end
|
321
395
|
|
322
|
-
# @param index [
|
396
|
+
# @param index [Integer]
|
323
397
|
# @return [Float]
|
324
398
|
def field_as_double(index)
|
325
399
|
FFI::OGR::API.OGR_F_GetFieldAsDouble(@c_pointer, index)
|
326
400
|
end
|
327
401
|
|
328
|
-
# @param index [
|
402
|
+
# @param index [Integer]
|
329
403
|
# @return [Array<Float>]
|
330
404
|
def field_as_double_list(index)
|
331
405
|
list_size_ptr = FFI::MemoryPointer.new(:int)
|
332
|
-
|
333
|
-
|
406
|
+
# This list is internal, and should not be modified, or freed. Its lifetime may be very brief.
|
407
|
+
list_ptr = FFI::OGR::API.OGR_F_GetFieldAsDoubleList(@c_pointer, index, list_size_ptr)
|
408
|
+
list_ptr.autorelease = false
|
409
|
+
|
334
410
|
return [] if list_ptr.null?
|
335
411
|
|
336
412
|
list_ptr.read_array_of_double(list_size_ptr.read_int)
|
337
413
|
end
|
338
414
|
|
339
|
-
# @param index [
|
415
|
+
# @param index [Integer]
|
340
416
|
# @return [String]
|
341
417
|
def field_as_string(index)
|
342
|
-
FFI::OGR::API.OGR_F_GetFieldAsString(@c_pointer, index)
|
418
|
+
field, ptr = FFI::OGR::API.OGR_F_GetFieldAsString(@c_pointer, index)
|
419
|
+
ptr.autorelease = false
|
420
|
+
|
421
|
+
field.force_encoding(Encoding::UTF_8)
|
343
422
|
end
|
344
423
|
|
345
|
-
# @param index [
|
424
|
+
# @param index [Integer]
|
346
425
|
# @return [Array<String>]
|
347
426
|
def field_as_string_list(index)
|
348
|
-
|
349
|
-
|
427
|
+
# This list is internal, and should not be modified, or freed. Its lifetime may be very brief.
|
428
|
+
list_ptr = FFI::OGR::API.OGR_F_GetFieldAsStringList(@c_pointer, index)
|
429
|
+
list_ptr.autorelease = false
|
430
|
+
|
350
431
|
return [] if list_ptr.null?
|
351
432
|
|
352
433
|
list_ptr.get_array_of_string(0)
|
353
434
|
end
|
354
435
|
|
355
|
-
# @param index [
|
436
|
+
# @param index [Integer]
|
356
437
|
# @return [String]
|
357
438
|
def field_as_binary(index)
|
358
439
|
byte_count_ptr = FFI::MemoryPointer.new(:int)
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
)
|
440
|
+
|
441
|
+
# This list is internal, and should not be modified, or freed. Its lifetime may be very brief.
|
442
|
+
binary_data_ptr = FFI::OGR::API.OGR_F_GetFieldAsBinary(@c_pointer, index, byte_count_ptr)
|
443
|
+
binary_data_ptr.autorelease = false
|
364
444
|
|
365
445
|
byte_count = byte_count_ptr.read_int
|
366
|
-
string = byte_count
|
446
|
+
string = byte_count.positive? ? binary_data_ptr.read_bytes(byte_count) : ''
|
367
447
|
|
368
448
|
string.unpack('C*')
|
369
449
|
end
|
@@ -377,7 +457,7 @@ module OGR
|
|
377
457
|
second_ptr = FFI::MemoryPointer.new(:int)
|
378
458
|
time_zone_flag_ptr = FFI::MemoryPointer.new(:int)
|
379
459
|
|
380
|
-
|
460
|
+
success = FFI::OGR::API.OGR_F_GetFieldAsDateTime(
|
381
461
|
@c_pointer,
|
382
462
|
index,
|
383
463
|
year_ptr,
|
@@ -388,11 +468,10 @@ module OGR
|
|
388
468
|
second_ptr,
|
389
469
|
time_zone_flag_ptr
|
390
470
|
)
|
391
|
-
return nil unless
|
471
|
+
return nil unless success
|
392
472
|
|
393
473
|
formatted_tz = OGR._format_time_zone_for_ruby(time_zone_flag_ptr.read_int)
|
394
474
|
|
395
|
-
# rubocop:disable Style/DateTime
|
396
475
|
if formatted_tz
|
397
476
|
DateTime.new(
|
398
477
|
year_ptr.read_int,
|
@@ -413,12 +492,14 @@ module OGR
|
|
413
492
|
second_ptr.read_int
|
414
493
|
)
|
415
494
|
end
|
416
|
-
# rubocop:enable Style/DateTime
|
417
495
|
end
|
418
496
|
|
419
497
|
# @return [String]
|
420
498
|
def style_string
|
421
|
-
FFI::OGR::API.OGR_F_GetStyleString(@c_pointer)
|
499
|
+
style, ptr = FFI::OGR::API.OGR_F_GetStyleString(@c_pointer)
|
500
|
+
ptr.autorelease = false
|
501
|
+
|
502
|
+
style
|
422
503
|
end
|
423
504
|
|
424
505
|
# @param new_style [String]
|
@@ -429,6 +510,8 @@ module OGR
|
|
429
510
|
# @return [OGR::StyleTable]
|
430
511
|
def style_table
|
431
512
|
style_table_ptr = FFI::OGR::API.OGR_F_GetStyleTable(@c_pointer)
|
513
|
+
style_table_ptr.autorelease = false
|
514
|
+
|
432
515
|
return nil if style_table_ptr.nil? || style_table_ptr.null?
|
433
516
|
|
434
517
|
OGR::StyleTable.new(style_table_ptr)
|
@@ -436,7 +519,8 @@ module OGR
|
|
436
519
|
|
437
520
|
# @param new_style_table [OGR::StyleTable]
|
438
521
|
def style_table=(new_style_table)
|
439
|
-
new_style_table_ptr = GDAL._pointer(OGR::StyleTable, new_style_table)
|
522
|
+
new_style_table_ptr = GDAL._pointer(OGR::StyleTable, new_style_table, autorelease: false)
|
523
|
+
|
440
524
|
raise OGR::InvalidStyleTable unless new_style_table_ptr
|
441
525
|
|
442
526
|
FFI::OGR::API.OGR_F_SetStyleTableDirectly(@c_pointer, new_style_table_ptr)
|
@@ -445,9 +529,10 @@ module OGR
|
|
445
529
|
private
|
446
530
|
|
447
531
|
def c_pointer_from(feature)
|
448
|
-
|
532
|
+
case feature
|
533
|
+
when OGR::Feature
|
449
534
|
feature.c_pointer
|
450
|
-
|
535
|
+
when FFI::Pointer
|
451
536
|
feature
|
452
537
|
end
|
453
538
|
end
|