Skip to content

operation module

This is the operation module.

This module contains geographic metadata structures regarding referencing system operations derived from the ISO 19111 international standard.

Conversion

Bases: SingleOperation

An operation on coordinates that does not include any change of Datum.

Source code in opengis/referencing/operation.py
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
class Conversion(SingleOperation):
    """
    An operation on coordinates that does not include any change of Datum.
    """

    @property
    @abstractmethod
    def source_crs(self) -> Optional[CoordinateReferenceSystem]:
        """
        Returns the source CRS. Conversions may have a source CRS that is not
        specified here, but through `DerivedCRS.getBaseCRS()` instead. `None`
        if not available.
        """

    @property
    @abstractmethod
    def target_crs(self) -> Optional[CoordinateReferenceSystem]:
        """
        Returns the target CRS. Conversions may have a target CRS that is not
        specified here, but through `DerivedCRS` instead. `None`
        if not available.
        """

    @property
    @abstractmethod
    def operation_version(self) -> None:
        """
        This attribute is declared in `CoordinateOperation` but is not used in
        a conversion.
        """
        return None

operation_version: None abstractmethod property

This attribute is declared in CoordinateOperation but is not used in a conversion.

source_crs: Optional[CoordinateReferenceSystem] abstractmethod property

Returns the source CRS. Conversions may have a source CRS that is not specified here, but through DerivedCRS.getBaseCRS() instead. None if not available.

target_crs: Optional[CoordinateReferenceSystem] abstractmethod property

Returns the target CRS. Conversions may have a target CRS that is not specified here, but through DerivedCRS instead. None if not available.

CoordinateOperation

Bases: IdentifiedObject

A mathematical operation on coordinates that transforms or converts coordinates to another coordinate reference system.

Source code in opengis/referencing/operation.py
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
class CoordinateOperation(IdentifiedObject):
    """
    A mathematical operation on coordinates that transforms or converts
    coordinates to another coordinate reference system.
    """

    @property
    @abstractmethod
    def source_crs(self) -> Optional[CoordinateReferenceSystem]:
        """
        Returns the source CRS. The source CRS is mandatory for
        transformations only. Conversions may have a source CRS that is not
        specified here, but through `DerivedCRS.getBaseCRS()` instead.
        `None` if not available.
        """

    @property
    @abstractmethod
    def target_crs(self) -> Optional[CoordinateReferenceSystem]:
        """
        Returns the target CRS. The target CRS is mandatory for
        transformations only. Conversions may have a target CRS that is not
        specified here, but through `DerivedCRS` instead. `None` if
        not available.
        """

    @property
    @abstractmethod
    def operation_version(self) -> Optional[str]:
        """
        Version of the coordinate transformation (i.e., instantiation due to
        the stochastic nature of the parameters). Mandatory when describing a
        transformation, and should not be supplied for a conversion.
        """

    @property
    @abstractmethod
    def coordinate_operation_accuracy(self) ->\
            Sequence[Optional[PositionalAccuracy]]:
        """
        Estimate(s) of the impact of this operation on point accuracy. Gives
        position error estimates for target coordinates of this coordinate
        operation, assuming no errors in source coordinates, or an empty
        collection if not available.
        """

    @property
    @abstractmethod
    def domain_of_validity(self) -> Optional[Extent]:
        """
        Area or region or timeframe in which this coordinate operation is
        valid or `None` if not available.
        """

    @property
    @abstractmethod
    def scope(self) -> str:
        """
        Description of domain of usage, or limitations of usage, for which
        this operation is valid.
        """

    @property
    @abstractmethod
    def math_transform(self) -> MathTransform:
        """
        Gets the math transform. The math transform will transform positions
        in the source coordinate reference system into positions in the target
        coordinate reference system. It may be `None` in the case of defining
        conversions or if it's not applicable.
        """

coordinate_operation_accuracy: Sequence[Optional[PositionalAccuracy]] abstractmethod property

Estimate(s) of the impact of this operation on point accuracy. Gives position error estimates for target coordinates of this coordinate operation, assuming no errors in source coordinates, or an empty collection if not available.

domain_of_validity: Optional[Extent] abstractmethod property

Area or region or timeframe in which this coordinate operation is valid or None if not available.

math_transform: MathTransform abstractmethod property

Gets the math transform. The math transform will transform positions in the source coordinate reference system into positions in the target coordinate reference system. It may be None in the case of defining conversions or if it's not applicable.

operation_version: Optional[str] abstractmethod property

Version of the coordinate transformation (i.e., instantiation due to the stochastic nature of the parameters). Mandatory when describing a transformation, and should not be supplied for a conversion.

scope: str abstractmethod property

Description of domain of usage, or limitations of usage, for which this operation is valid.

source_crs: Optional[CoordinateReferenceSystem] abstractmethod property

Returns the source CRS. The source CRS is mandatory for transformations only. Conversions may have a source CRS that is not specified here, but through DerivedCRS.getBaseCRS() instead. None if not available.

target_crs: Optional[CoordinateReferenceSystem] abstractmethod property

Returns the target CRS. The target CRS is mandatory for transformations only. Conversions may have a target CRS that is not specified here, but through DerivedCRS instead. None if not available.

Formula

Specification of the coordinate operation method formula.

Source code in opengis/referencing/operation.py
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
class Formula:
    """
    Specification of the coordinate operation method formula.
    """

    @property
    @abstractmethod
    def formula(self) -> str:
        """
        Formula(s) or procedure used by the operation method.

        :return: The formula used by the operation method, or null if none.
        :rtype: str
        """

    @property
    @abstractmethod
    def citation(self) -> Optional[Citation]:
        """
        Reference to a publication giving the formula(s) or procedure used by
        the coordinate operation method, or null if `None`.
        """

citation: Optional[Citation] abstractmethod property

Reference to a publication giving the formula(s) or procedure used by the coordinate operation method, or null if None.

formula: str abstractmethod property

Formula(s) or procedure used by the operation method.

:return: The formula used by the operation method, or null if none. :rtype: str

MathTransform

Bases: ABC

Transforms multi-dimensional coordinate points.

Source code in opengis/referencing/operation.py
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
class MathTransform(ABC):
    """
    Transforms multi-dimensional coordinate points.
    """

    @property
    @abstractmethod
    def source_dimensions(self) -> int:
        """
        Returns the dimension of input points.
        """

    @property
    @abstractmethod
    def target_dimensions(self) -> int:
        """
        Returns the dimension of output points.
        """

    @property
    @abstractmethod
    def is_identity(self) -> bool:
        """
        Tests whether this transform does not move any points. True if this
        MathTransform is an identity transform; false otherwise.
        """

    @abstractmethod
    def to_wkt(self) -> str:
        """
        Returns a Well Known Text (WKT) for this object. Well know text are
        defined in extended Backus Naur form. This operation may fails if an
        object is too complex for the WKT format capability.
        """

    @abstractmethod
    def inverse(self) -> Any:
        """
        Creates the inverse transform of this object. This method may fail if
        the transform is not one to one. Should return a
        `MathTransform` object.
        """

    @abstractmethod
    def transform(self, pt_src: DirectPosition,
                  pt_dst: Optional[DirectPosition]) ->\
            DirectPosition | np.ndarray:
        """
        Transforms the specified pt_src and stores the result in pt_dst.

        Arguments:
            pt_src (DirectPosition): the specified coordinate point to
                be transformed.
            pt_dst (Optional[DirectPosition]): the specified coordinate point that
                stores the result of transforming ptSrc, or null.
        Returns:
            The coordinate point or an array of coordinate points
                after transforming pt_src and storing the result in pt_dst,
                or a newly created point if pt_dst was null.
        """

    @abstractmethod
    def transform_list(
        self,
        src_pts: np.ndarray,
        src_off: int,
        dst_pts: np.ndarray,
        dst_off: int,
        num_pts: int,
        ):
        """
        Transforms a list of coordinate point ordinal values. This method is
        provided for efficiently transforming many points. The supplied array
        of ordinal values will contain packed ordinal values. For example, if
        the source dimension is 3, then the ordinals will be packed in this
        order: (x0,y0,z0, x1,y1,z1 ...).

        :param src_pts: the array containing the source point coordinates.
        :type src_pts: numpy.ndarray
        :param src_off: the offset to the first point to be transformed in the
            source array.
        :type src_off: int
        :param dst_pts: the array into which the transformed point coordinates
            are returned. May be the same as srcPts
        :type dst_pts: numpy.ndarray
        :param dst_off: the offset to the location of the first transformed
            point that is stored in the destination
        :type dst_off: int
        :param num_pts: the number of point objects to be transformed.
        :type num_pts: int
        """

    @abstractmethod
    def derivative(self, point: DirectPosition) -> np.ndarray:
        """
        Gets the derivative of this transform at a point (never null).
        The derivative is the matrix of the non-translating portion of
        the approximate affine map at the point. The matrix will have
        dimensions corresponding to the source and target coordinate systems.

        Parameters:
            point (DirectPosition): The coordinate point where to evaluate the
                derivative. Null value is accepted only if the derivative is
                the same everywhere (e.g., with affine transforms). But most
                map projection will requires a non-null value.
        """

is_identity: bool abstractmethod property

Tests whether this transform does not move any points. True if this MathTransform is an identity transform; false otherwise.

source_dimensions: int abstractmethod property

Returns the dimension of input points.

target_dimensions: int abstractmethod property

Returns the dimension of output points.

derivative(point) abstractmethod

Gets the derivative of this transform at a point (never null). The derivative is the matrix of the non-translating portion of the approximate affine map at the point. The matrix will have dimensions corresponding to the source and target coordinate systems.

Parameters:

Name Type Description Default
point DirectPosition

The coordinate point where to evaluate the derivative. Null value is accepted only if the derivative is the same everywhere (e.g., with affine transforms). But most map projection will requires a non-null value.

required
Source code in opengis/referencing/operation.py
137
138
139
140
141
142
143
144
145
146
147
148
149
150
@abstractmethod
def derivative(self, point: DirectPosition) -> np.ndarray:
    """
    Gets the derivative of this transform at a point (never null).
    The derivative is the matrix of the non-translating portion of
    the approximate affine map at the point. The matrix will have
    dimensions corresponding to the source and target coordinate systems.

    Parameters:
        point (DirectPosition): The coordinate point where to evaluate the
            derivative. Null value is accepted only if the derivative is
            the same everywhere (e.g., with affine transforms). But most
            map projection will requires a non-null value.
    """

inverse() abstractmethod

Creates the inverse transform of this object. This method may fail if the transform is not one to one. Should return a MathTransform object.

Source code in opengis/referencing/operation.py
80
81
82
83
84
85
86
@abstractmethod
def inverse(self) -> Any:
    """
    Creates the inverse transform of this object. This method may fail if
    the transform is not one to one. Should return a
    `MathTransform` object.
    """

to_wkt() abstractmethod

Returns a Well Known Text (WKT) for this object. Well know text are defined in extended Backus Naur form. This operation may fails if an object is too complex for the WKT format capability.

Source code in opengis/referencing/operation.py
72
73
74
75
76
77
78
@abstractmethod
def to_wkt(self) -> str:
    """
    Returns a Well Known Text (WKT) for this object. Well know text are
    defined in extended Backus Naur form. This operation may fails if an
    object is too complex for the WKT format capability.
    """

transform(pt_src, pt_dst) abstractmethod

Transforms the specified pt_src and stores the result in pt_dst.

Parameters:

Name Type Description Default
pt_src DirectPosition

the specified coordinate point to be transformed.

required
pt_dst Optional[DirectPosition]

the specified coordinate point that stores the result of transforming ptSrc, or null.

required

Returns: The coordinate point or an array of coordinate points after transforming pt_src and storing the result in pt_dst, or a newly created point if pt_dst was null.

Source code in opengis/referencing/operation.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
@abstractmethod
def transform(self, pt_src: DirectPosition,
              pt_dst: Optional[DirectPosition]) ->\
        DirectPosition | np.ndarray:
    """
    Transforms the specified pt_src and stores the result in pt_dst.

    Arguments:
        pt_src (DirectPosition): the specified coordinate point to
            be transformed.
        pt_dst (Optional[DirectPosition]): the specified coordinate point that
            stores the result of transforming ptSrc, or null.
    Returns:
        The coordinate point or an array of coordinate points
            after transforming pt_src and storing the result in pt_dst,
            or a newly created point if pt_dst was null.
    """

transform_list(src_pts, src_off, dst_pts, dst_off, num_pts) abstractmethod

Transforms a list of coordinate point ordinal values. This method is provided for efficiently transforming many points. The supplied array of ordinal values will contain packed ordinal values. For example, if the source dimension is 3, then the ordinals will be packed in this order: (x0,y0,z0, x1,y1,z1 ...).

:param src_pts: the array containing the source point coordinates. :type src_pts: numpy.ndarray :param src_off: the offset to the first point to be transformed in the source array. :type src_off: int :param dst_pts: the array into which the transformed point coordinates are returned. May be the same as srcPts :type dst_pts: numpy.ndarray :param dst_off: the offset to the location of the first transformed point that is stored in the destination :type dst_off: int :param num_pts: the number of point objects to be transformed. :type num_pts: int

Source code in opengis/referencing/operation.py
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
@abstractmethod
def transform_list(
    self,
    src_pts: np.ndarray,
    src_off: int,
    dst_pts: np.ndarray,
    dst_off: int,
    num_pts: int,
    ):
    """
    Transforms a list of coordinate point ordinal values. This method is
    provided for efficiently transforming many points. The supplied array
    of ordinal values will contain packed ordinal values. For example, if
    the source dimension is 3, then the ordinals will be packed in this
    order: (x0,y0,z0, x1,y1,z1 ...).

    :param src_pts: the array containing the source point coordinates.
    :type src_pts: numpy.ndarray
    :param src_off: the offset to the first point to be transformed in the
        source array.
    :type src_off: int
    :param dst_pts: the array into which the transformed point coordinates
        are returned. May be the same as srcPts
    :type dst_pts: numpy.ndarray
    :param dst_off: the offset to the location of the first transformed
        point that is stored in the destination
    :type dst_off: int
    :param num_pts: the number of point objects to be transformed.
    :type num_pts: int
    """

MathTransform1D

Bases: MathTransform

Transforms one-dimensional coordinate points.

Source code in opengis/referencing/operation.py
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
class MathTransform1D(MathTransform):
    """
    Transforms one-dimensional coordinate points.
    """

    @abstractmethod
    def inverse(self) -> 'MathTransform1D':
        """
        Creates the inverse transform of this object.
        """

    @abstractmethod
    def transform_value(self, value: float) -> float:
        """
        Transforms the specified value.

        Parameters:
            value (float): The value to transform.
        """

inverse() abstractmethod

Creates the inverse transform of this object.

Source code in opengis/referencing/operation.py
158
159
160
161
162
@abstractmethod
def inverse(self) -> 'MathTransform1D':
    """
    Creates the inverse transform of this object.
    """

transform_value(value) abstractmethod

Transforms the specified value.

Parameters:

Name Type Description Default
value float

The value to transform.

required
Source code in opengis/referencing/operation.py
164
165
166
167
168
169
170
171
@abstractmethod
def transform_value(self, value: float) -> float:
    """
    Transforms the specified value.

    Parameters:
        value (float): The value to transform.
    """

OperationMethod

Bases: IdentifiedObject

Definition of an algorithm used to perform a coordinate operation.

Source code in opengis/referencing/operation.py
212
213
214
215
216
217
218
219
220
221
222
223
224
225
class OperationMethod(IdentifiedObject):
    """
    Definition of an algorithm used to perform a coordinate operation.
    """

    @property
    @abstractmethod
    def formula(self) -> Formula:
        """
        Formula(s) or procedure used by this operation method. This may be a
        reference to a publication. Note that the operation method may not be
        analytic, in which case this attribute references or contains the
        procedure, not an analytic formula.
        """

formula: Formula abstractmethod property

Formula(s) or procedure used by this operation method. This may be a reference to a publication. Note that the operation method may not be analytic, in which case this attribute references or contains the procedure, not an analytic formula.

PassThroughOperation

Bases: SingleOperation

A pass-through operation specifies that a subset of a coordinate tuple is subject to a specific coordinate operation.

Source code in opengis/referencing/operation.py
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
class PassThroughOperation(SingleOperation):
    """
    A pass-through operation specifies that a subset of a coordinate tuple is
    subject to a specific coordinate operation.
    """

    @property
    @abstractmethod
    def operation(self) -> SingleOperation:
        """
        Returns the operation to apply on the subset of a coordinate tuple.
        """

    @property
    @abstractmethod
    def modified_coordinates(self) -> Sequence[int]:
        """
        Ordered sequence of positive integers defining the positions in a
        coordinate tuple of the coordinates affected by this pass-through
        operation. Returns the modified coordinates.
        """

modified_coordinates: Sequence[int] abstractmethod property

Ordered sequence of positive integers defining the positions in a coordinate tuple of the coordinates affected by this pass-through operation. Returns the modified coordinates.

operation: SingleOperation abstractmethod property

Returns the operation to apply on the subset of a coordinate tuple.

SingleOperation

Bases: CoordinateOperation

A parameterized mathematical operation on coordinates that transforms or converts coordinates to another coordinate reference system.

Source code in opengis/referencing/operation.py
308
309
310
311
312
313
314
315
316
317
318
319
class SingleOperation(CoordinateOperation):
    """
    A parameterized mathematical operation on coordinates that transforms or
    converts coordinates to another coordinate reference system.
    """

    @property
    @abstractmethod
    def method(self) -> OperationMethod:
        """
        Returns the operation method.
        """

method: OperationMethod abstractmethod property

Returns the operation method.

Transformation

Bases: SingleOperation

An operation on coordinates that usually includes a change of Datum.

Source code in opengis/referencing/operation.py
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
class Transformation(SingleOperation):
    """
    An operation on coordinates that usually includes a change of Datum.
    """

    @property
    @abstractmethod
    def source_crs(self) -> CoordinateReferenceSystem:
        """
        Returns the source CRS (never null).
        """

    @property
    @abstractmethod
    def target_crs(self) -> CoordinateReferenceSystem:
        """
        Returns the target CRS (never null).
        """

    @property
    @abstractmethod
    def operation_version(self) -> str:
        """
        Version of the coordinate transformation (i.e., instantiation due to
        the stochastic nature of the parameters). This attribute is mandatory
        in a Transformation.
        """

operation_version: str abstractmethod property

Version of the coordinate transformation (i.e., instantiation due to the stochastic nature of the parameters). This attribute is mandatory in a Transformation.

source_crs: CoordinateReferenceSystem abstractmethod property

Returns the source CRS (never null).

target_crs: CoordinateReferenceSystem abstractmethod property

Returns the target CRS (never null).