Skip to content

Commit ea4db96

Browse files
committed
changed geocoder to Nominatim which uses OpenStreetMap
[Nominatum](https://nominatim.org/release-docs/develop/api/Overview/) doesn't have a limit but [AUP](https://operations.osmfoundation.org/policies/nominatim/) which states: We are in principle happy for the public API to be used by external users for creative and unexpected uses. However, be aware that the service runs on donated servers and has a very limited capacity. We therefore ask you to limit your use and adhere to this usage policy. Requirements: No heavy uses (an absolute maximum of 1 request per second). Provide a valid HTTP Referer or User-Agent identifying the application (stock User-Agents as set by http libraries will not do). Clearly display attribution as suitable for your medium. Data is provided under the ODbL license which requires to share alike (although small extractions are likely to be covered by fair usage / fair dealing).
1 parent 947b8d5 commit ea4db96

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

ch00python/010exemplar.ipynb

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@
6161
},
6262
{
6363
"cell_type": "code",
64-
"execution_count": 1,
64+
"execution_count": 2,
6565
"metadata": {
6666
"ExecuteTime": {
67-
"end_time": "2020-08-06T13:18:09.338640Z",
68-
"start_time": "2020-08-06T13:18:09.252262Z"
67+
"end_time": "2020-08-06T14:46:08.595382Z",
68+
"start_time": "2020-08-06T14:46:08.505509Z"
6969
}
7070
},
7171
"outputs": [],
@@ -88,27 +88,36 @@
8888
},
8989
{
9090
"cell_type": "code",
91-
"execution_count": 2,
91+
"execution_count": 7,
9292
"metadata": {
9393
"ExecuteTime": {
94-
"end_time": "2020-08-06T13:18:10.351958Z",
95-
"start_time": "2020-08-06T13:18:09.809013Z"
94+
"end_time": "2020-08-06T14:50:39.740475Z",
95+
"start_time": "2020-08-06T14:50:39.242606Z"
9696
}
9797
},
9898
"outputs": [
9999
{
100100
"data": {
101101
"text/plain": [
102-
"[Location(Cambridge, UK, (52.2053855332241, 0.12181995849728, 0.0))]"
102+
"[Location(Cambridge, Cambridgeshire, East of England, England, United Kingdom, (52.2034823, 0.1235817, 0.0)),\n",
103+
" Location(Cambridge, Cambridgeshire, East of England, England, United Kingdom, (52.2034823, 0.1235817, 0.0)),\n",
104+
" Location(Cambridge, Middlesex County, Massachusetts, United States of America, (42.3750997, -71.1056157, 0.0)),\n",
105+
" Location(Cambridge, Waterloo Region, Southwestern Ontario, Ontario, N1R 1T7, Canada, (43.3600536, -80.3123023, 0.0)),\n",
106+
" Location(Cambridge, Henry County, Illinois, United States of America, (41.3036472, -90.1928971, 0.0)),\n",
107+
" Location(Cambridge, Isanti County, Minnesota, 55008, United States of America, (45.5727408, -93.2243921, 0.0)),\n",
108+
" Location(Cambridge, Story County, Iowa, 50046, United States of America, (41.8990768, -93.5294029, 0.0)),\n",
109+
" Location(Cambridge, Dorchester County, Maryland, 21613, United States of America, (38.5714624, -76.0763177, 0.0)),\n",
110+
" Location(Cambridge, Guernsey County, Ohio, 43725, United States of America, (40.031183, -81.5884561, 0.0)),\n",
111+
" Location(Cambridge, Jefferson County, Kentucky, United States of America, (38.2217369, -85.616627, 0.0))]"
103112
]
104113
},
105-
"execution_count": 2,
114+
"execution_count": 7,
106115
"metadata": {},
107116
"output_type": "execute_result"
108117
}
109118
],
110119
"source": [
111-
"geocoder = geopy.geocoders.GeocodeFarm()\n",
120+
"geocoder = geopy.geocoders.Nominatim(user_agent=\"mphy0021\")\n",
112121
"geocoder.geocode('Cambridge', exactly_one=False)"
113122
]
114123
},

0 commit comments

Comments
 (0)