curviriver.interpolation
========================

.. py:module:: curviriver.interpolation

.. autoapi-nested-parse::

   Interpolating point cloud values to a grid using Inverse Distance Weighting (IDW).

   ..
       !! processed by numpydoc !!




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

.. py:function:: idw_line_interpolation(point_cloud: geopandas.GeoDataFrame, xs_lines: geopandas.GeoDataFrame | geopandas.GeoSeries, value_col: str, centerline: shapely.LineString | None = None, pc_xsection: bool = False, search_radius_coeff: float = 3.0, grid_points: Literal[False] = False, parallel: bool = False) -> geopandas.GeoSeries
                 idw_line_interpolation(point_cloud: geopandas.GeoDataFrame, xs_lines: geopandas.GeoDataFrame | geopandas.GeoSeries, value_col: str, centerline: shapely.LineString | None = None, pc_xsection: bool = False, search_radius_coeff: float = 3.0, grid_points: Literal[True] = True, parallel: bool = False) -> geopandas.GeoDataFrame

   
   Interpolate point cloud values to a grid using Inverse Distance Weighting (IDW).

   :Parameters: * **point_cloud** (:class:`geopandas.GeoDataFrame`) -- Point cloud with values to be interpolated.
                  Using a projected CRS is highly recommended.
                * **xs_lines** (:class:`geopandas.GeoDataFrame` or :class:`geopandas.GeoSeries`) -- Cross-section lines to which values will be interpolated.
                  Using a projected CRS is highly recommended.
                * **value_col** (:class:`str`) -- Name of the column in point_cloud containing values to be interpolated.
                * **centerline** (:class:`shapely.LineString`, *optional*) -- Centerline of ``point_cloud`` convex hull. Required when ``pc_xsection=True``.
                * **pc_xsection** (:class:`bool`, *optional*) -- Whether the point cloud is from surveys done perpendicular to the centerline,
                  instead of many points along the centerline. Default is ``False``.
                * **search_radius_coeff** (:class:`float`, *optional*) -- Coefficient to multiply the average distance between the closest and second
                  closest points to estimate the search radius. Default is 3.
                * **grid_points** (:class:`bool`, *optional*) -- If ``True``, the interpolated values will be returned as a GeoDataFrame
                  with the grid points as geometries. Default is ``False``.
                * **parallel** (:class:`bool`, *optional*) -- Whether to use parallel processing, defaults to ``False``.
                  For parallel processing, ``joblib`` package must be installed.

   :returns: :class:`geopandas.GeoSeries` or :class:`geopandas.GeoDataFrame` -- If ``grid_points=False`` a GeoSeries of 3D line where the Z-coordinate
             is the interpolated value. If ``grid_points=True`` a GeoDataFrame of
             2D points with a column called ``value_col`` containing the interpolated value.















   ..
       !! processed by numpydoc !!

.. py:function:: idw_point_interpolation(point_cloud, grid_points, centerline = None, pc_xsection = False, search_radius_coeff = 3.0, parallel = False)

   
   Interpolate point cloud values to a grid using Inverse Distance Weighting (IDW).

   :Parameters: * **point_cloud** (:class:`numpy.ndarray`) -- Point cloud with values to be interpolated. The array must have 3 columns
                  with the X, Y coordinates of the points as the first two columns and the
                  values to be interpolated as the third column.
                * **grid_points** (:class:`numpy.ndarray`) -- Grid points to which values will be interpolated. The array must have 2
                  columns with the X, Y coordinates of the points. The coordinates must be
                  in the same CRS as point_cloud.
                * **centerline** (:class:`shapely.LineString`, *optional*) -- Centerline of ``point_cloud`` convex hull. Required when ``pc_xsection=True``.
                * **pc_xsection** (:class:`bool`, *optional*) -- Whether the point cloud is from surveys done perpendicular to the centerline,
                  instead of many points along the centerline. Default is ``False``.
                * **search_radius_coeff** (:class:`float`, *optional*) -- Coefficient to multiply the average distance between the closest and second
                  closest points to estimate the search radius. Default is 3.
                * **parallel** (:class:`bool`, *optional*) -- Whether to use parallel processing, defaults to ``False``.
                  For parallel processing, ``joblib`` package must be installed.

   :returns: :class:`numpy.ndarray` -- Grid points with a third column containing the interpolated values.















   ..
       !! processed by numpydoc !!

.. py:function:: xs_hydraulics(line)

   
   Compute cross-section hydraulics properties.

   :Parameters: **line** (:class:`shapely.LineString`) -- Cross-section line with Z-coordinate.

   :returns: * **area** (:class:`float`) -- Cross-sectional area.
             * **preimeter** (:class:`float`) -- Cross-sectional perimeter.















   ..
       !! processed by numpydoc !!

