a
    !h                     @   sp   d Z dZdZdZdZdZdZdZd Zdd Z	dd Z
d	d
d
dd
dddZd	d
ddZdd Zdd Zdd Zd
S )                c                 C   s   | d> | d? A S )zReturn the "zig-zag" encoded unsigned integer corresponding to the signed input integer. This encoding is
    used for MVT geometry deltas.r       nr   r   f/var/www/staging/api/virtual_environments/venv/lib/python3.9/site-packages/mapbox_vector_tile/utils.pyzig_zag_encode   s    r   c                 C   s   | d? | d@  A S )zReturn the signed integer corresponding to the "zig-zag" encoded unsigned input integer. This encoding is
    used for MVT geometry deltas.r   r   r   r   r   r
   zig_zag_decode   s    r   FNi   T   )y_coord_downtransformerZquantize_boundsextentsZon_invalid_geometryZcheck_winding_ordermax_geometry_validate_tries)r   r   Zgeojsonc           	      C   s   |du r|}| du r|} |  }|| ||  t| }t| }||}|rddd t|D }td| d| d|S )a@  Get the entire options dictionary filled using: first, the provided `layer_options`, then the provided
    `default_options` and finally filled using the provided `global_default_options`.

    Args:
        layer_options:
            The options for the current layer.

        default_options:
            The default options of the operation.

        global_default_options:
            The global default options for the operation.

        operation_name:
            The name of the current operation.

    Returns:
        The options to use to operate the layer.
    Nz, c                 s   s   | ]}t |V  qd S )N)str).0xr   r   r
   	<genexpr>V       z_get_options.<locals>.<genexpr>z*The following options are not allowed for z	 a tile: .)copyupdatesetkeys
differencejoinsorted
ValueError)	layer_optionsdefault_optionsglobal_default_optionsoperation_nameresultZresult_keysZexpected_keysZ
extra_keysZextra_keys_msgr   r   r
   _get_options4   s    


r%   c                 C   sT   t | |tdd}|d }|d }|dkr8td| d|dkrPtd| d|S )	a  Get the entire encoding options dictionary filled using: first, the provided `layer_options`, then the provided
    `default_options` and finally filled using the global default options

    Args:
        layer_options:
            The options for the current layer.

        default_options:
            The default options of the encoding operation.

    Returns:
        The options to use for encoding the layer.
    encodingr    r!   r"   r#   r   r   r   zThe extents must be positive. z
 provided.z2The max_geometry_validate_tries must be positive. )r%   DEFAULT_ENCODE_OPTIONSr   )r    r!   r$   r   r   r   r   r
   get_encode_options\   s    r)   c                 C   s   t | |tddS )a  Get the entire decoding options dictionary filled using: first, the provided `layer_options`, then the provided
    `default_options` and finally filled using the global default options

    Args:
        layer_options:
            The options for the current layer.

        default_options:
            The default options of the decoding operation.

    Returns:
        The options to use for decoding the layer.
    Zdecodingr'   )r%   DEFAULT_DECODE_OPTIONS)r    r!   r   r   r
   get_decode_options|   s    r+   )ZCMD_BITSZCMD_MOVE_TOZCMD_LINE_TOZCMD_SEG_ENDZCMD_FAKEUNKNOWNZPOINTZ
LINESTRINGZPOLYGONr   r   r(   r*   r%   r)   r+   r   r   r   r
   <module>   s,   
( 