
    .h                     j    S SK Jr  S SKJr  S SKJr  S SKJrJr  S SK	J
r
  S SKJr  Sr " S S	\5      rg
)    )partial)	urlencode)GeocoderQueryError)DEFAULT_SENTINELGeocoderLocation)logger)DataBCc                   f   ^  \ rS rSrSrSrS\\S\SSS.U 4S jjrSS	S
S\S.S jrS r	S r
SrU =r$ )r      zGeocoder using the Physical Address Geocoder from DataBC.

Documentation at:
    https://github.com/bcgov/ols-geocoder/blob/gh-pages/geocoder-developer-guide.md
z/addresses.geojsonNzgeocoder.api.gov.bc.ca)schemetimeoutproxies
user_agentssl_contextadapter_factorydomainc          	      t   > [         TU ]  UUUUUUS9  U R                  < SU< U R                  < 3U l        g)ax  

:param str scheme:
    See :attr:`geopy.geocoders.options.default_scheme`.

:param int timeout:
    See :attr:`geopy.geocoders.options.default_timeout`.

:param dict proxies:
    See :attr:`geopy.geocoders.options.default_proxies`.

:param str user_agent:
    See :attr:`geopy.geocoders.options.default_user_agent`.

:type ssl_context: :class:`ssl.SSLContext`
:param ssl_context:
    See :attr:`geopy.geocoders.options.default_ssl_context`.

:param callable adapter_factory:
    See :attr:`geopy.geocoders.options.default_adapter_factory`.

    .. versionadded:: 2.0

:param str domain: base api domain

    .. versionadded:: 2.4
)r   r   r   r   r   r   z://N)super__init__r   geocode_pathapi)	selfr   r   r   r   r   r   r   	__class__s	           iC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\geopy/geocoders/databc.pyr   DataBC.__init__   sD    L 	!#+ 	 	
 #'++vt7H7HI       r   anyT)max_resultsset_backlocation_descriptorexactly_oner   c                N   SU0nUS:w  a  X7S'   US;  a  [        S5      eXGS'   U(       a  SnX'S'   S	R                  U R                  [        U5      45      n[        R
                  " S
U R                  R                  U5        [        U R                  US9n	U R                  XUS9$ )a  
Return a location point by address.

:param str query: The address or query you wish to geocode.

:param int max_results: The maximum number of resutls to request.

:param float set_back: The distance to move the accessPoint away
    from the curb (in meters) and towards the interior of the parcel.
    location_descriptor must be set to accessPoint for set_back to
    take effect.

:param str location_descriptor: The type of point requested. It
    can be any, accessPoint, frontDoorPoint, parcelPoint,
    rooftopPoint and routingPoint.

:param bool exactly_one: Return one result or a list of results, if
    available.

:param int timeout: Time, in seconds, to wait for the geocoding service
    to respond before raising a :class:`geopy.exc.GeocoderTimedOut`
    exception. Set this only if you wish to override, on this call
    only, the value set during the geocoder's initialization.

:rtype: ``None``, :class:`geopy.location.Location` or a list of them, if
    ``exactly_one=False``.
addressStringr   setBack)r    accessPointfrontDoorPointparcelPointrooftopPointroutingPointzYou did not provided a location_descriptor the webservice can consume. It should be any, accessPoint, frontDoorPoint, parcelPoint, rooftopPoint or routingPoint.locationDescriptor   
maxResults?z%s.geocode: %s)r$   )r   )r   joinr   r   r
   debugr   __name__r   _parse_json_call_geocoder)
r   queryr!   r"   r#   r$   r   paramsurlcallbacks
             r   geocodeDataBC.geocodeE   s    J "5)q= (9 '7 7 %M 
 (;#$K*|hh)F"345%t~~'>'>D4++E""3'"BBr   c                     [        US   5      (       d  g / nUS    H#  nUR                  U R                  U5      5        M%     U(       a  US   $ U$ )Nfeaturesr   )lenappend_parse_feature)r   responser$   geocodedfeatures        r   r4   DataBC._parse_json   sR    8J'((
+GOOD//89 ,A;r   c                 L    US   nUS   S   n[        US   US   US   4U5      $ )N
propertiesgeometrycoordinatesfullAddressr.   r   r   )r   rC   rF   rH   s       r   r@   DataBC._parse_feature   sB    \*
j)-8}%AA'G
 	
r   )r   )r3   
__module____qualname____firstlineno____doc__r   r   r   r:   r4   r@   __static_attributes____classcell__)r   s   @r   r   r      sZ     (L
 $$( +.J .Jh  %$;Cz	
 
r   r   N)	functoolsr   urllib.parser   	geopy.excr   geopy.geocoders.baser   r   geopy.locationr	   
geopy.utilr
   __all__r    r   r   <module>rY      s*     " ( ; # 
G
X G
r   