Skip to content

Commit 38b802e

Browse files
authored
set no_annotations=1, add comment about optional params
1 parent f1e1fff commit 38b802e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

examples/batch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,14 @@ def backoff_hdlr(details):
8181
async def geocode_one_address(address, address_id):
8282
async with OpenCageGeocode(api_key) as geocoder:
8383
# address -> coordinates
84-
geocoding_results = await geocoder.geocode_async(address)
84+
# note: you may also want to set other optional parameters like
85+
# countrycode, language, etc
86+
# see the full list: https://opencagedata.com/api#forward-opt
87+
geocoding_results = await geocoder.geocode_async(address, no_annotations=1)
8588

8689
# coordinates -> address, e.g. '40.78,-73.97' => 101, West 91st Street, New York
8790
# lon_lat = address.split(',')
88-
# geocoding_result = await geocoder.reverse_geocode_async(lon_lat[0], lon_lat[1])
91+
# geocoding_result = await geocoder.reverse_geocode_async(lon_lat[0], lon_lat[1], no_annotations=1)
8992
# returns a single result so we convert it to a list
9093
# geocoding_results = [geocoding_result]
9194

0 commit comments

Comments
 (0)