a
    î}cÚ  ã                   @   s.   d dl Zd dlmZ dd„ ZG dd„ dƒZdS )é    N)ÚPointc                 C   s   | j | jd | jd ffS )Nr   é   )Ú_addressÚ_point)Úlocation© r   úJ/var/www/html/django/DPS/env/lib/python3.9/site-packages/geopy/location.pyÚ_location_tuple   s    r	   c                   @   s¬   e Zd ZdZdZdd„ Zedd„ ƒZedd„ ƒZed	d
„ ƒZ	edd„ ƒZ
edd„ ƒZedd„ ƒZdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd „ Zd!d"„ Zd#S )$ÚLocationa,  
    Contains a parsed geocoder response. Can be iterated over as
    ``(location<String>, (latitude<float>, longitude<Float))``.
    Or one can access the properties ``address``, ``latitude``,
    ``longitude``, or ``raw``. The last
    is a dictionary of the geocoder's response for this item.
    )r   r   Ú_tupleÚ_rawc                 C   sŒ   |d u rt dƒ‚|| _t|tƒr(|| _n@t|tƒr>t|ƒ| _n*t|tjjƒrXt|ƒ| _nt dt	|ƒ ƒ‚t
| ƒ| _|d u r‚t dƒ‚|| _d S )Nz`address` must not be Nonez"`point` is of unsupported type: %rz`raw` must not be None)Ú	TypeErrorr   Ú
isinstancer   r   ÚstrÚcollectionsÚabcÚSequenceÚtyper	   r   r   )ÚselfÚaddressÚpointÚrawr   r   r   Ú__init__   s     


ÿ
zLocation.__init__c                 C   s   | j S )z™
        Location as a formatted string returned by the geocoder or constructed
        by geopy, depending on the service.

        :rtype: str
        ©r   ©r   r   r   r   r   *   s    zLocation.addressc                 C   s
   | j d S )z=
        Location's latitude.

        :rtype: float
        r   ©r   r   r   r   r   Úlatitude4   s    zLocation.latitudec                 C   s
   | j d S )z>
        Location's longitude.

        :rtype: float
        r   r   r   r   r   r   Ú	longitude=   s    zLocation.longitudec                 C   s
   | j d S )a  
        Location's altitude.

        .. note::
            Geocoding services usually don't consider altitude neither in
            requests nor in responses, so almost always the value of this
            property would be zero.

        :rtype: float
        é   r   r   r   r   r   ÚaltitudeF   s    zLocation.altitudec                 C   s   | j S )z¨
        :class:`geopy.point.Point` instance representing the location's
        latitude, longitude, and altitude.

        :rtype: :class:`geopy.point.Point`
        r   r   r   r   r   r   T   s    zLocation.pointc                 C   s   | j S )z•
        Location's raw, unparsed geocoder response. For details on this,
        consult the service's documentation.

        :rtype: dict
        )r   r   r   r   r   r   ^   s    zLocation.rawc                 C   s
   | j | S )zA
        Backwards compatibility with geopy<0.98 tuples.
        )r   )r   Úindexr   r   r   Ú__getitem__h   s    zLocation.__getitem__c                 C   s   | j S ©Nr   r   r   r   r   Ú__str__n   s    zLocation.__str__c                 C   s   d| j | j| j| jf S )NzLocation(%s, (%s, %s, %s)))r   r   r   r   r   r   r   r   Ú__repr__q   s    ÿzLocation.__repr__c                 C   s
   t | jƒS r"   )Úiterr   r   r   r   r   Ú__iter__v   s    zLocation.__iter__c                 C   s   | j | j| jfS r"   )r   r   r   r   r   r   r   Ú__getstate__y   s    zLocation.__getstate__c                 C   s   |\| _ | _| _t| ƒ| _d S r"   )r   r   r   r	   r   )r   Ústater   r   r   Ú__setstate__|   s    zLocation.__setstate__c                 C   s.   t |tƒo,| j|jko,| j|jko,| j|jkS r"   )r   r
   r   r   r   ©r   Úotherr   r   r   Ú__eq__€   s    

ÿ
þ
üzLocation.__eq__c                 C   s
   | |k S r"   r   r*   r   r   r   Ú__ne__ˆ   s    zLocation.__ne__c                 C   s
   t | jƒS r"   )Úlenr   r   r   r   r   Ú__len__‹   s    zLocation.__len__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   Úpropertyr   r   r   r   r   r   r!   r#   r$   r&   r'   r)   r,   r-   r/   r   r   r   r   r
   
   s0   
	



	
	r
   )Úcollections.abcr   Zgeopy.pointr   r	   r
   r   r   r   r   Ú<module>   s   