:py:mod:`geovista.transform`
============================

.. py:module:: geovista.transform

.. autoapi-nested-parse::

   Coordinate reference system (CRS) transformation functions.

   Notes
   -----
   .. versionadded:: 0.3.0

   ..
       !! processed by numpydoc !!


Module Contents
---------------


Functions
~~~~~~~~~

.. autoapisummary::

   geovista.transform.transform_mesh
   geovista.transform.transform_point
   geovista.transform.transform_points



.. py:function:: transform_mesh(mesh, tgt_crs, slice_connectivity = True, rtol = None, atol = None, zlevel = None, zscale = None, inplace = False)

   
   Transform the mesh from its source CRS to the target CRS.


   :Parameters:

       **mesh** : :obj:`PolyData <pyvista.PolyData>`
           The mesh to be transformed from its source coordinate reference system (CRS) to
           the given `tgt_crs`.

       **tgt_crs** : :obj:`CRSLike <geovista.crs.CRSLike>`
           The target coordinate reference system (CRS) of the transformation.
           May be anything accepted by :meth:`pyproj.crs.CRS.from_user_input`.

       **slice_connectivity** : :class:`python:bool`, default=True
           Slice the mesh prior to transformation in order to break mesh connectivity and
           create a seam in the mesh. Also see :func:`geovista.core.slice_mesh`.

       **rtol** : :class:`python:float`, optional
           The relative tolerance for longitudes close to the 'wrap meridian' -
           see :func:`geovista.common.wrap` for more.

       **atol** : :class:`python:float`, optional
           The absolute tolerance for longitudes close to the 'wrap meridian' -
           see :func:`geovista.common.wrap` for more.

       **zlevel** : :class:`python:int` or :obj:`ArrayLike <numpy.typing.ArrayLike>`, default=0
           The z-axis level. Used in combination with the `zscale` to offset the
           `radius`/vertical by a proportional amount e.g., ``radius * zlevel * zscale``.
           If `zlevel` is not a scalar, then its shape must match or broadcast
           with the shape of the ``mesh.points``.

       **zscale** : :class:`python:float`, optional
           The proportional multiplier for z-axis `zlevel`. Defaults to
           :data:`geovista.common.ZLEVEL_SCALE`.

       **inplace** : :class:`python:bool`, default=False
           Update the `mesh` in-place. Can only perform an in-place operation when
           ``slice_connectivity=False``.



   :Returns:

       :obj:`PolyData <pyvista.PolyData>`
           The mesh transformed to the target coordinate reference system (CRS).








   .. rubric:: Notes

   .. versionadded:: 0.3.0



   ..
       !! processed by numpydoc !!

.. py:function:: transform_point(src_crs, tgt_crs, x, y, z = None, trap = True)

   
   Transform the spatial point from the source to the target CRS.


   :Parameters:

       **src_crs** : :obj:`CRSLike <geovista.crs.CRSLike>`
           The source Coordinate Reference System (CRS) of the provided `x`,
           `y` and `z` spatial point. May be anything accepted by
           :meth:`pyproj.crs.CRS.from_user_input`.

       **tgt_crs** : :obj:`CRSLike <geovista.crs.CRSLike>`
           The target Coordinate Reference System (CRS) of the transform for
           the spatial point. May be anything accepted by
           :meth:`pyproj.crs.CRS.from_user_input`.

       **x** : :obj:`ArrayLike <numpy.typing.ArrayLike>`
           The spatial point x-value, in canonical `src_crs` units, to be
           transformed from the `src_crs` to the `tgt_crs`. Must be a scalar
           or a single valued 1-D array.

       **y** : :obj:`ArrayLike <numpy.typing.ArrayLike>`
           The spatial point y-value, in canonical `src_crs` units, to be
           transformed from the `src_crs` to the `tgt_crs`. Must be scalar
           (0-dimensional).

       **z** : :obj:`ArrayLike <numpy.typing.ArrayLike>`, optional
           The spatial point z-value, in canonical `src_crs` units, to be
           transformed from the `src_crs` to the `tgt_crs`. Must be scalar
           (0-dimensional).

       **trap** : :class:`python:bool`, default=True
           Raise an exception if an error occurs during CRS transformation
           of the spatial point. Otherwise, ``inf`` will be returned for
           the erroneous point.



   :Returns:

       :obj:`ArrayLike <numpy.typing.ArrayLike>`
           The transformed spatial point in the canonical units of the target
           CRS. The shape of the result will be ``(3,)``.








   .. rubric:: Notes

   .. versionadded:: 0.4.0



   ..
       !! processed by numpydoc !!

.. py:function:: transform_points(src_crs, tgt_crs, xs, ys, zs = None, trap = True)

   
   Transform the spatial points from the source to the target CRS.


   :Parameters:

       **src_crs** : :obj:`CRSLike <geovista.crs.CRSLike>`
           The source Coordinate Reference System (CRS) of the provided `xs`,
           `ys` and `zs` spatial points. May be anything accepted by
           :meth:`pyproj.crs.CRS.from_user_input`.

       **tgt_crs** : :obj:`CRSLike <geovista.crs.CRSLike>`
           The target Coordinate Reference System (CRS) of the transform for
           the spatial points. May be anything accepted by
           :meth:`pyproj.crs.CRS.from_user_input`.

       **xs** : :obj:`ArrayLike <numpy.typing.ArrayLike>`
           The spatial points x-values, in canonical `src_crs` units, to be
           transformed from the `src_crs` to the `tgt_crs`. May be scalar,
           1-D or 2-D.

       **ys** : :obj:`ArrayLike <numpy.typing.ArrayLike>`
           The spatial points y-values, in canonical `src_crs` units, to be
           transformed from the `src_crs` to the `tgt_crs`. May be scalar,
           1-D or 2-D.

       **zs** : :obj:`ArrayLike <numpy.typing.ArrayLike>`, optional
           The spatial points z-values, in canonical `src_crs` units, to be
           transformed from the `src_crs` to the `tgt_crs`. May be scalar,
           1-D or 2-D.

       **trap** : :class:`python:bool`, default=True
           Raise an exception if an error occurs during CRS transformation
           of the spatial points. Otherwise, ``inf`` will be returned for
           erroneous points.



   :Returns:

       :obj:`ArrayLike <numpy.typing.ArrayLike>`
           The transformed spatial points in the canonical units of the target
           CRS. The shape of the result will either be ``(1, 3)``, ``(M, 3)``
           or ``(M, N, 3)`` depending on whether the provided spatial points
           were scalar, 1-D or 2-D, respectively.








   .. rubric:: Notes

   .. versionadded:: 0.4.0



   ..
       !! processed by numpydoc !!

