a
    1$ep                     @   sn   d Z ddlmZ ddlmZmZmZ ddlmZ eddG dd dZ	G d	d
 d
eZ
eG dd dZdS )zC
This module contains the structures related to areas of interest.
    )	dataclass)
NamedTupleOptionalUnion)is_nullT)frozenc                   @   s:   e Zd ZU dZeed< eed< eed< eed< dd ZdS )	AreaOfInterestz|
    .. versionadded:: 2.3.0

    This is the area of interest for:

    - Transformations
    - Querying for CRS data.
    west_lon_degreesouth_lat_degreeeast_lon_degreenorth_lat_degreec                 C   s4   t | js(t | js(t | js(t | jr0tdd S Nz#NaN or None values are not allowed.)r   r	   r
   r   r   
ValueErrorself r   F/var/www/html/django/DPS/env/lib/python3.9/site-packages/pyproj/aoi.py__post_init__   s    zAreaOfInterest.__post_init__N)__name__
__module____qualname____doc__float__annotations__r   r   r   r   r   r   
   s   

r   c                   @   sn   e Zd ZU dZeed< eed< eed< eed< dZee ed< e	e
eeeef dd	d
ZedddZdS )	AreaOfUsezb
    .. versionadded:: 2.0.0

    Area of Use for CRS, CoordinateOperation, or a Transformer.
    westsoutheastnorthNname)returnc                 C   s   | j | j| j| jfS )z
        The bounds of the area of use.

        Returns
        -------
        tuple[float, float, float, float]
            west, south, east, and north bounds.
        )r   r   r   r   r   r   r   r   bounds:   s    
zAreaOfUse.boundsc                 C   s   d| j  d| j S )Nz- name: z
- bounds: )r   r!   r   r   r   r   __str__F   s    zAreaOfUse.__str__)r   r   r   r   r   r   r   r   strpropertytupler!   r"   r   r   r   r   r   (   s   
r   c                   @   sj   e Zd ZU dZeed< eed< eed< eed< dd Zed ef e	dd	d
Z
ed ef e	dddZdS )BBoxzs
    Bounding box to check if data intersects/contains other
    bounding boxes.

    .. versionadded:: 3.0.0

    r   r   r   r   c                 C   s4   t | js(t | js(t | js(t | jr0tdd S r   )r   r   r   r   r   r   r   r   r   r   r   ]   s    zBBox.__post_init__)otherr    c                 C   s0   | j |jk o.|j | jk o.| j|jk o.|j| jk S )z
        Parameters
        ----------
        other: BBox
            The other BBox to use to check.

        Returns
        -------
        bool:
            True if this BBox intersects the other bbox.
        r   r   r   r   r   r'   r   r   r   
intersectsf   s    


zBBox.intersectsc                 C   s0   |j | j ko.|j| jko.|j| jko.|j| jkS )z
        Parameters
        ----------
        other: Union["BBox", AreaOfUse]
            The other BBox to use to check.

        Returns
        -------
        bool:
            True if this BBox contains the other bbox.
        r(   r)   r   r   r   containsy   s    


zBBox.containsN)r   r   r   r   r   r   r   r   r   boolr*   r+   r   r   r   r   r&   J   s   
		r&   N)r   dataclassesr   typingr   r   r   Zpyproj.utilsr   r   r   r&   r   r   r   r   <module>   s   "