
    !\i                     N    S r SSKJr  SSKJr  SSKJr  SSKJr  \ SS j5       r	g)	z=Fill holes in raster dataset by interpolation from the edges.    )MaskedArray)_fillnodata)
ensure_env)dtypesNc                 j   Uc"  [        U [        5      (       a  U R                  ) n[        R                  " U5      (       d  [        S5      e[        U [        5      (       a  U R                  n [        R                  " U 5      (       d  [        S5      e[        U5      n[        U5      n[        XX#5      $ )a  Fill holes in raster data by interpolation

This algorithm will interpolate values for all designated nodata
pixels (marked by zeros in `mask`). For each pixel a four direction
conic search is done to find values to interpolate from (using
inverse distance weighting). Once all values are interpolated, zero
or more smoothing iterations (3x3 average filters on interpolated
pixels) are applied to smooth out artifacts.

This algorithm is generally suitable for interpolating missing
regions of fairly continuously varying rasters (such as elevation
models for instance). It is also suitable for filling small holes
and cracks in more irregularly varying images (like aerial photos).
It is generally not so great for interpolating a raster from sparse
point data.

Parameters
----------
image : numpy.ndarray
    The source image with holes to be filled. If a MaskedArray, the
    inverse of its mask will define the pixels to be filled --
    unless the ``mask`` argument is not None (see below).`
mask : numpy.ndarray, optional
    A mask band indicating which pixels to interpolate. Pixels to
    interpolate into are indicated by the value 0. Values
    > 0 indicate areas to use during interpolation. Must be same
    shape as image. This array always takes precedence over the
    image's mask (see above). If None, the inverse of the image's
    mask will be used if available.
max_search_distance : float, optional
    The maximum number of pixels to search in all directions to
    find values to interpolate from. The default is 100.
smoothing_iterations : integer, optional
    The number of 3x3 smoothing filter passes to run. The default is
    0.
filloptions :
    Keyword arguments providing finer control over filling. See
    https://gdal.org/en/stable/api/gdal_alg.html. Lowercase option
    names and numerical values are allowed. For example:
    nodata=0 is a valid keyword argument.

Returns
-------
numpy.ndarray :
    The filled raster array.
zAn mask array is requiredzAn image array is required)

isinstancer   maskr   
is_ndarray
ValueErrordatafloatintr   )imager	   max_search_distancesmoothing_iterationsfilloptionss        P/var/www/html/kml_chatgpt/mouzaenv/lib/python3.13/site-packages/rasterio/fill.py
fillnodatar   
   s    d |
5+66

{T""455%%%

U##566 3434u$7NN    )Ng      Y@r   )
__doc__numpy.mar   rasterio._fillr   rasterio.envr   rasterior   r    r   r   <module>r      s-    C   & #  FG=O =Or   