U
    7h                     @   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   H/var/www/formularioweb/env/lib/python3.8/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 krt d|| _t|tr(|| _n@t|tr>t|| _n*t|tjjrXt|| _nt dt	| t
| | _|d krt 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   