
    !\i                        S r SSKJr  SSKrSSKrSSKJr  SSKrSSKJ	r	  S r
SS jr\R                  " S	S
S9\R                  \R                  " S\
SSS9\R                  " SSSSS9\R                  " SSSSS9\R                  " SS\R                  " \	 V s/ s H  o R                   PM     sn 5      SSS9\R"                  S 5       5       5       5       5       5       5       rgs  sn f )zManage overviews of a dataset.    )reduceN   )options)OverviewResamplingc                    U(       a   SU;   a`  UR                  S5      u  p4S UR                  S5       5       u  pV[        XVS-   5       Vs/ s H  n[        [        U5      U5      PM     nnU$ SU;   a,  UR                  S5       Vs/ s H  n[        U5      PM     nnU$ US:X  a   U$ [        eU$ s  snf s  snf ! [         a    [
        R                  " S5      ef = f)N^c              3   8   #    U  H  n[        U5      v   M     g 7f)N)int).0vs     X/var/www/html/kml_chatgpt/mouzaenv/lib/python3.13/site-packages/rasterio/rio/overview.py	<genexpr> build_handler.<locals>.<genexpr>   s     #J4IqCFF4Is   z..r   ,autou,   must match 'n,n,n,…', 'n^n..n', or 'auto'.)splitrangepowr
   	ExceptionclickBadParameter)	ctxparamvaluebase	exp_rangeexp_minexp_maxkr   s	            r   build_handlerr       s    	Ue|"'++c"2#JIOOD4I#J 49'Q;4OP4OqSY*4OP L ).S)9:)9AQ)9: L &
 L   L Q:
  	U$$%STT	Us<   AB< B2+B< /B< B7B< !B< *B< 2
B< <!Cc                 v    SnSn[        X-  X-  5      U:  a   US-  nUS-  n[        X-  X-  5      U:  a  M   U$ )aD  
Calculate the maximum overview level of a dataset at which
the smallest overview is smaller than `minsize`.

Attributes
----------
width : int
    Width of the dataset.
height : int
    Height of the dataset.
minsize : int (default: 256)
    Minimum overview size.

Returns
-------
overview_level: int
    overview level.

r   r      )min)widthheightminsizeoverview_leveloverview_factors        r   get_maximum_overview_levelr)      sV    ( NO
e&(A
BW
L1! e&(A
BW
L     overviewz+Construct overviews in an existing dataset.)
short_helpz--buildu   f1,f2,…|b^min..max|autozA sequence of decimation factors specified as comma-separated list of numbers or a base and range of exponents, or 'auto' to automatically determine the maximum factor.)callbackmetavarhelpz--lsz"Print the overviews for each band.TF)r/   is_flagdefaultz	--rebuildzReconstruct existing overviews.z--resamplingzResampling algorithm.nearest)r/   typer1   show_defaultc                    U R                   S      U(       a  [        R                  " US5       nUR                  SS9R	                  S5      =(       d    Sn[
        R                  " S5        UR                   H6  n[
        R                  " SXR                  U5      =(       d    S	U4-  5        M8     S
S
S
5        GOmU(       a  [        R                  " US5       n[        [        R                  UR                   V	s/ s H  n	[        UR                  U	5      5      PM     sn	5      n
UR                  SS9R	                  S5      =(       d    UnUR                  [        U
5      [        U   5        S
S
S
5        OU(       a  [        R                  " US5       nUS:X  aB  [!        UR"                  UR$                  5      n['        SUS-   5       Vs/ s H  nSU-  PM
     nnUR                  U[        U   5        UR)                  SUS9  S
S
S
5        O[
        R*                  " S5      eS
S
S
5        g
! , (       d  f       N= fs  sn	f ! , (       d  f       N-= fs  snf ! , (       d  f       NC= f! , (       d  f       g
= f)a  Construct overviews in an existing dataset.

A pyramid of overviews computed once and stored in the dataset can
improve performance in some applications.

The decimation levels at which to build overviews can be specified as
a comma separated list

  rio overview --build 2,4,8,16

or a base and range of exponents

  rio overview --build 2^1..4

or 'auto' to automatically determine the maximum decimation level at
which the smallest overview is smaller than 256 pixels in size.

  rio overview --build auto

Note that overviews can not currently be removed and are not
automatically updated when the dataset's primary bands are
modified.

Information about existing overviews can be printed using the --ls
option.

  rio overview --ls

envrrio_overview)ns
resamplingunknownzOverview factors:z  Band %d: %s (method: '%s')NoneNzr+r   r   r"   )r9   r:   z.Please specify --ls, --rebuild, or --build ...)objrasterioopentagsgetr   echoindexes	overviewsr   operatoror_setbuild_overviewslistr   r)   r$   r%   r   update_tags
UsageError)r   inputbuildlsrebuildr:   dstresampling_methodidxifactorsr'   js                r   r+   r+   <   s   l 
uc*c$'HH% %- %''*s<'8%F<E " 

./;;CJJ=]]3/96;LAN  N O ' +* ud+s LL47KK@KqSq)*K@B
 %(HH% %- %''*s<'8%G<F " ##M#56G#HJ ,+ ud+sF?%?		3::%VN-21nq6H-IJ-IQ!V-IEJ##E+=j+IJ >jI ,+ ""@B BG 
** A	 ,+" K ,+3 
sx   I0BH33(I0#I	>$I"AI	2'I08II +II03
I	=I0I		
I	I0I
I-	)I00
I>)   )__doc__	functoolsr   rE   r    r   r>   rasterio.enumsr   r    r)   commandfile_in_argoptionChoicenamepass_contextr+   )its   0r   <module>rb      s   $      -$: z&ST'
J	 
5tU 7u 	 	);<);2ww);<	= BB   U0BB =s   C"