o
    Dfp                     @   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   4   t | jst | jst | jst | jrtdd S Nz#NaN or None values are not allowed.)r   r	   r
   r   r   
ValueErrorself r   C/home/ubuntu/webapp/venv/lib/python3.10/site-packages/pyproj/aoi.py__post_init__      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	de
eeeef fd	d
Zdef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                   @   sn   e Zd ZU dZeed< eed< eed< eed< dd Zded ef d	e	fd
dZ
ded ef d	e	f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   r   r   )r   r   r   r   r    r   r   r   r   r   r   ]   r   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      


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   r-   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   pyproj.utilsr   r   r   r(   r   r   r   r   <module>   s    "