Module: OGR::LayerMixins::OGRLayerMethodMethods

Included in:
OGR::Layer
Defined in:
lib/ogr/layer_mixins/ogr_layer_method_methods.rb

Overview

OGR::Layer methods: Ruby methods that operate on a OGR::Layer using a “method layer”. The method layer is combined with the current layer in some fashion, which results in a new OGR::Layer.

Instance Method Summary collapse

Instance Method Details

#clip(method_layer, output_layer, **options, &progress) ⇒ Object

Clip off areas of this layer that are not covered by the method layer. The result layer contains features whose geometries represent areas that are in the input layer and in the method layer. The features in the result layer have the (possibly clipped) areas of features in the input layer and the attributes from the same features.

Parameters:

Options Hash (**options):

  • skip_failures (:yes, :no) — default: :no

    Setting to :yes lets the function continue even when a feature could not be inserted.

  • promote_to_multi (:yes, :no) — default: :no

    Setting to :yes converts Polygons to MultiPolygons, LineStrings to MultiLineStrings.

  • input_prefix (String)

    Set a prefix for the field names that will be created from the fields of the input Layer.

  • method_prefix (String)

    Set a prefix for the field names that will be created from the fields of the method Layer.

Raises:



26
27
28
# File 'lib/ogr/layer_mixins/ogr_layer_method_methods.rb', line 26

def clip(method_layer, output_layer, **options, &progress)
  run_layer_method(:OGR_L_Clip, method_layer, output_layer, **options, &progress)
end

#erase(method_layer, output_layer, **options, &progress) ⇒ Object

Remove areas in this layer that are covered by the method layer.

The result layer contains features whose geometries represent areas that are in this layer but not in the method layer. The features in the result layer have attributes from this layer.

Parameters:

Options Hash (**options):

  • skip_failures (:yes, :no) — default: :no

    Setting to :yes lets the function continue even when a feature could not be inserted.

  • promote_to_multi (:yes, :no) — default: :no

    Setting to :yes converts Polygons to MultiPolygons, LineStrings to MultiLineStrings.

  • input_prefix (String)

    Set a prefix for the field names that will be created from the fields of the input Layer.

  • method_prefix (String)

    Set a prefix for the field names that will be created from the fields of the method Layer.

Raises:



47
48
49
# File 'lib/ogr/layer_mixins/ogr_layer_method_methods.rb', line 47

def erase(method_layer, output_layer, **options, &progress)
  run_layer_method(:OGR_L_Erase, method_layer, output_layer, **options, &progress)
end

#identity(method_layer, output_layer, **options, &progress) ⇒ Object

The result layer contains features whose geometries represent areas that are in the input layer. The features in the result layer have attributes from both input and method layers.

Parameters:

Options Hash (**options):

  • skip_failures (:yes, :no) — default: :no

    Setting to :yes lets the function continue even when a feature could not be inserted.

  • promote_to_multi (:yes, :no) — default: :no

    Setting to :yes converts Polygons to MultiPolygons, LineStrings to MultiLineStrings.

  • input_prefix (String)

    Set a prefix for the field names that will be created from the fields of the input Layer.

  • method_prefix (String)

    Set a prefix for the field names that will be created from the fields of the method Layer.

Raises:



66
67
68
# File 'lib/ogr/layer_mixins/ogr_layer_method_methods.rb', line 66

def identity(method_layer, output_layer, **options, &progress)
  run_layer_method(:OGR_L_Identity, method_layer, output_layer, **options, &progress)
end

#intersection(method_layer, output_layer, **options, &progress) ⇒ Object

Intersection of this layer and method_layer.

Parameters:

Options Hash (**options):

  • skip_failures (:yes, :no) — default: :no

    Setting to :yes lets the function continue even when a feature could not be inserted.

  • promote_to_multi (:yes, :no) — default: :no

    Setting to :yes converts Polygons to MultiPolygons, LineStrings to MultiLineStrings.

  • input_prefix (String)

    Set a prefix for the field names that will be created from the fields of the input Layer.

  • method_prefix (String)

    Set a prefix for the field names that will be created from the fields of the method Layer.

Raises:



83
84
85
# File 'lib/ogr/layer_mixins/ogr_layer_method_methods.rb', line 83

def intersection(method_layer, output_layer, **options, &progress)
  run_layer_method(:OGR_L_Intersection, method_layer, output_layer, **options, &progress)
end

#symmetrical_difference(method_layer, output_layer, **options, &progress) ⇒ Object

The result layer contains features whose geometries represent areas that are either in this layer or the method layer, but not in both. The features in the result layer have attributes from both this layer and the method layer. For features which represent areas that are only in this layer or the method layer, the respective attributes have undefined values.

Parameters:

Options Hash (**options):

  • skip_failures (:yes, :no) — default: :no

    Setting to :yes lets the function continue even when a feature could not be inserted.

  • promote_to_multi (:yes, :no) — default: :no

    Setting to :yes converts Polygons to MultiPolygons, LineStrings to MultiLineStrings.

  • input_prefix (String)

    Set a prefix for the field names that will be created from the fields of the input Layer.

  • method_prefix (String)

    Set a prefix for the field names that will be created from the fields of the method Layer.

Raises:



105
106
107
# File 'lib/ogr/layer_mixins/ogr_layer_method_methods.rb', line 105

def symmetrical_difference(method_layer, output_layer, **options, &progress)
  run_layer_method(:OGR_L_SymDifference, method_layer, output_layer, **options, &progress)
end

#union(method_layer, output_layer, **options, &progress) ⇒ Object

The result layer contains features whose geometries represent areas that are either in this layer or the method layer. The features in the result layer have attributes from both this layer and the method layer. For features which represent areas that are only in this or in the method layer, the respective attributes have undefined values.

Parameters:

Options Hash (**options):

  • skip_failures (:yes, :no) — default: :no

    Setting to :yes lets the function continue even when a feature could not be inserted.

  • promote_to_multi (:yes, :no) — default: :no

    Setting to :yes converts Polygons to MultiPolygons, LineStrings to MultiLineStrings.

  • input_prefix (String)

    Set a prefix for the field names that will be created from the fields of the input Layer.

  • method_prefix (String)

    Set a prefix for the field names that will be created from the fields of the method Layer.

Raises:



126
127
128
# File 'lib/ogr/layer_mixins/ogr_layer_method_methods.rb', line 126

def union(method_layer, output_layer, **options, &progress)
  run_layer_method(:OGR_L_Union, method_layer, output_layer, **options, &progress)
end

#update(method_layer, output_layer, **options, &progress) ⇒ Object

Update this layer with features from the update layer. The result layer contains features whose geometries represent areas that are either in this layer or the method layer. The features in the result layer have areas of the features of the method layer or those areas of the features of this layer that are not covered by the method layer. The features of the result layer get their attributes from this layer.

Parameters:

Options Hash (**options):

  • skip_failures (:yes, :no) — default: :no

    Setting to :yes lets the function continue even when a feature could not be inserted.

  • promote_to_multi (:yes, :no) — default: :no

    Setting to :yes converts Polygons to MultiPolygons, LineStrings to MultiLineStrings.

  • input_prefix (String)

    Set a prefix for the field names that will be created from the fields of the input Layer.

  • method_prefix (String)

    Set a prefix for the field names that will be created from the fields of the method Layer.

Raises:



148
149
150
# File 'lib/ogr/layer_mixins/ogr_layer_method_methods.rb', line 148

def update(method_layer, output_layer, **options, &progress)
  run_layer_method(:OGR_L_Update, method_layer, output_layer, **options, &progress)
end