You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The almost missing Geocoder PHP 5.3 library</p>
20
20
21
21
<pclass="view"><ahref="https://github.com/willdurand/Geocoder">View the Project on GitHub <small>willdurand/Geocoder</small></a></p>
22
22
@@ -92,7 +92,7 @@ <h3>HttpAdapters</h3>
92
92
<li>
93
93
<ahref="http://www.ign.fr/">IGN OpenLS</a> as Address-Based geocoding provider (exclusively in France);</li>
94
94
<li>
95
-
<ahref="http://www.datasciencetoolkit.org/">DataScienceToolkit</a> as IP-Based geocoding provider;</li>
95
+
<ahref="http://www.datasciencetoolkit.org/">DataScienceToolkit</a> as IP-Based geocoding provider or an Address-Based provider (exclusively in USA & Canada);</li>
96
96
<li>
97
97
<ahref="http://api.yandex.com.tr/maps/doc/geocoder/desc/concepts/About.xml">Yandex</a> as Address-Based geocoding and reverse geocoding provider;</li>
98
98
<li>
@@ -102,7 +102,11 @@ <h3>HttpAdapters</h3>
102
102
<li>
103
103
<ahref="http://dev.maxmind.com/geoip/web-services">MaxMind web service</a> as IP-Based geocoding provider (City/ISP/Org and Omni services);</li>
104
104
<li>
105
-
<ahref="http://www.geonames.org/">Geonames</a> as Place-Based geocoding and reverse geocoding provider.</li>
105
+
<ahref="http://www.geonames.org/">Geonames</a> as Place-Based geocoding and reverse geocoding provider;</li>
106
+
<li>
107
+
<ahref="http://ipgeobase.ru/">IpGeoBase</a> as IP-Based geocoding provider (very accurate in Russia);</li>
108
+
<li>
109
+
<ahref="http://developer.baidu.com/map/geocoding-api.htm">Baidu</a> as Address-Based geocoding and reverse geocoding provider (exclusively in China).</li>
106
110
</ul><h2>Installation</h2>
107
111
108
112
<p>The recommended way to install Geocoder is through composer.</p>
@@ -159,109 +163,119 @@ <h2>Usage</h2>
159
163
160
164
<h3>FreeGeoIpProvider</h3>
161
165
162
-
<p>The <code>FreeGeoIpProvider</code> is able to geocode <strong>IPv4 and IPv6 addresses</strong> only.</p>
166
+
<p>The <code>FreeGeoIpProvider</code>named <code>free_geo_ip</code>is able to geocode <strong>IPv4 and IPv6 addresses</strong> only.</p>
163
167
164
168
<h3>HostIpProvider</h3>
165
169
166
-
<p>The <code>HostIpProvider</code> is able to geocode <strong>IPv4 addresses</strong> only.</p>
170
+
<p>The <code>HostIpProvider</code>named <code>host_ip</code>is able to geocode <strong>IPv4 addresses</strong> only.</p>
167
171
168
172
<h3>IpInfoDbProvider</h3>
169
173
170
-
<p>The <code>IpInfoDbProvider</code> is able to geocode <strong>IPv4 addresses</strong> only.
174
+
<p>The <code>IpInfoDbProvider</code>named <code>ip_info_db</code>is able to geocode <strong>IPv4 addresses</strong> only.
171
175
A valid api key is required.</p>
172
176
173
177
<h3>YahooProvider</h3>
174
178
175
-
<p>The <code>YahooProvider</code> is able to geocode both <strong>IPv4 addresses</strong> and <strong>street addresses</strong>.
176
-
This provider can also reverse information based on coordinates (latitude, longitude).
179
+
<p>The <code>YahooProvider</code> named <code>yahoo</code> is able to geocode both <strong>IPv4 addresses</strong> and <strong>street addresses</strong>. This provider can also reverse information based on coordinates (latitude, longitude).
177
180
A valid api key is required.</p>
178
181
179
182
<h3>GoogleMapsProvider</h3>
180
183
181
-
<p>The <code>GoogleMapsProvider</code> is able to geocode and reverse geocode <strong>street addresses</strong>.</p>
184
+
<p>The <code>GoogleMapsProvider</code>named <code>google_maps</code>is able to geocode and reverse geocode <strong>street addresses</strong>.</p>
182
185
183
186
<h3>GoogleMapsBusinessProvider</h3>
184
187
185
-
<p>The <code>GoogleMapsBusinessProvider</code> is able to geocode and reverse geocode <strong>street addresses</strong>.
188
+
<p>The <code>GoogleMapsBusinessProvider</code>named <code>google_maps_business</code>is able to geocode and reverse geocode <strong>street addresses</strong>.
186
189
A valid <code>Client ID</code> is required. The private key is optional.</p>
187
190
188
191
<h3>BingMapsProvider</h3>
189
192
190
-
<p>The <code>BingMapsProvider</code> is able to geocode and reverse geocode <strong>street addresses</strong>.
193
+
<p>The <code>BingMapsProvider</code>named <code>bing_maps</code>is able to geocode and reverse geocode <strong>street addresses</strong>.
191
194
A valid api key is required.</p>
192
195
193
196
<h3>OpenStreetMapsProvider</h3>
194
197
195
-
<p>The <code>OpenStreetMapsProvider</code> is able to geocode and reverse geocode <strong>street addresses</strong>.</p>
198
+
<p>The <code>OpenStreetMapsProvider</code>named <code>openstreetmaps</code>is able to geocode and reverse geocode <strong>street addresses</strong>.</p>
196
199
197
200
<h3>CloudMadeProvider</h3>
198
201
199
-
<p>The <code>CloudMadeProvider</code> is able to geocode and reverse geocode <strong>street addresses</strong>.
202
+
<p>The <code>CloudMadeProvider</code>named <code>cloudmade</code>is able to geocode and reverse geocode <strong>street addresses</strong>.
200
203
A valid api key is required.</p>
201
204
202
205
<h3>GeoipProvider</h3>
203
206
204
-
<p>The <code>GeoipProvider</code> is able to geocode <strong>IPv4 and IPv6 addresses</strong> only. No need to use an <code>HttpAdapter</code> as it uses a local database.
207
+
<p>The <code>GeoipProvider</code>named <code>geoip</code>is able to geocode <strong>IPv4 and IPv6 addresses</strong> only. No need to use an <code>HttpAdapter</code> as it uses a local database.
205
208
See the <ahref="http://www.maxmind.com/app/php">MaxMind page</a> for more information.</p>
206
209
207
210
<h3>ChainProvider</h3>
208
211
209
-
<p>The <code>ChainProvider</code> is a special provider that takes a list of providers and iterates over this list to get information.</p>
212
+
<p>The <code>ChainProvider</code>named <code>chain</code>is a special provider that takes a list of providers and iterates over this list to get information.</p>
210
213
211
214
<h3>MapQuestProvider</h3>
212
215
213
-
<p>The <code>MapQuestProvider</code> is able to geocode and reverse geocode <strong>street addresses</strong>.</p>
216
+
<p>The <code>MapQuestProvider</code>named <code>map_quest</code>is able to geocode and reverse geocode <strong>street addresses</strong>.</p>
214
217
215
218
<h3>OIORestProvider</h3>
216
219
217
-
<p>The <code>OIORestProvider</code> is able to geocode and reverse geocode <strong>street addresses</strong>, exclusively in Denmark.</p>
220
+
<p>The <code>OIORestProvider</code>named <code>oio_rest</code>is able to geocode and reverse geocode <strong>street addresses</strong>, exclusively in Denmark.</p>
218
221
219
222
<h3>GeocoderCaProvider</h3>
220
223
221
-
<p>The <code>GeocoderCaProvider</code> is able to geocode and reverse geocode <strong>street addresses</strong>, exclusively in USA & Canada.</p>
224
+
<p>The <code>GeocoderCaProvider</code>named <code>geocoder_ca</code>is able to geocode and reverse geocode <strong>street addresses</strong>, exclusively in USA & Canada.</p>
222
225
223
226
<h3>GeocoderUsProvider</h3>
224
227
225
-
<p>The <code>GeocoderUsProvider</code> is able to geocode <strong>street addresses</strong> only, exclusively in USA.</p>
228
+
<p>The <code>GeocoderUsProvider</code>named <code>geocoder_us</code>is able to geocode <strong>street addresses</strong> only, exclusively in USA.</p>
226
229
227
230
<h3>IGNOpenLSProvider</h3>
228
231
229
-
<p>The <code>IGNOpenLSProvider</code> is able to geocode <strong>street addresses</strong> only, exclusively in France.
230
-
A valid api key is required.</p>
232
+
<p>The <code>IGNOpenLSProvider</code>named <code>ign_openls</code>is able to geocode <strong>street addresses</strong> only, exclusively in France.
233
+
A valid OpenLS api key is required.</p>
231
234
232
235
<h3>DataScienceToolkitProvider</h3>
233
236
234
-
<p>The <code>DataScienceToolkitProvider</code> is able to geocode <strong>IPv4 addresses</strong>only.</p>
237
+
<p>The <code>DataScienceToolkitProvider</code>named <code>data_science_toolkit</code>is able to geocode <strong>IPv4 addresses</strong>and <strong>street adresses</strong>, exclusively in USA & Canada.</p>
235
238
236
239
<h3>YandexProvider</h3>
237
240
238
-
<p>The <code>YandexProvider</code> is able to geocode and reverse geocode <strong>street addresses</strong>.
241
+
<p>The <code>YandexProvider</code>named <code>yandex</code>is able to geocode and reverse geocode <strong>street addresses</strong>.
239
242
The default langage-locale is <code>ru-RU</code>, you can choose between <code>uk-UA</code>, <code>be-BY</code>,
240
243
<code>en-US</code>, <code>en-BR</code> and <code>tr-TR</code>.
241
244
This provider can also reverse information based on coordinates (latitude,
242
-
longitude). It's possible to precise the toponym to get more accurate result:
245
+
longitude). It's possible to precise the toponym to get more accurate result for reverse geocoding:
243
246
<code>house</code>, <code>street</code>, <code>metro</code>, <code>district</code> and <code>locality</code>.</p>
244
247
245
248
<h3>GeoPluginProvider</h3>
F42D
246
249
247
-
<p>The <code>GeoPluginProvider</code> is able to geocode <strong>IPv4 addresses and IPv6 addresses</strong> only.</p>
250
+
<p>The <code>GeoPluginProvider</code>named <code>geo_plugin</code>is able to geocode <strong>IPv4 addresses and IPv6 addresses</strong> only.</p>
248
251
249
252
<h3>GeoIPsProvider</h3>
250
253
251
-
<p>The <code>GeoIPsProvider</code> is able to geocode <strong>IPv4 addresses</strong> only.
254
+
<p>The <code>GeoIPsProvider</code>named <code>geo_ips</code>is able to geocode <strong>IPv4 addresses</strong> only.
252
255
A valid api key is required.</p>
253
256
254
257
<h3>MaxMindProvider</h3>
255
258
256
-
<p>The <code>MaxMindProvider</code> is able to geocode <strong>IPv4 and IPv6 addresses</strong> only.
259
+
<p>The <code>MaxMindProvider</code>named <code>maxmind</code>is able to geocode <strong>IPv4 and IPv6 addresses</strong> only.
257
260
A valid <code>City/ISP/Org</code> or <code>Omni</code> service's api key is required.
258
261
This provider provides two constants <code>CITY_EXTENDED_SERVICE</code> by default and <code>OMNI_SERVICE</code>.</p>
259
262
260
263
<h3>GeonamesProvider</h3>
261
264
262
-
<p>The <code>GeonamesProvider</code> is able to geocode and reverse geocode <strong>places</strong>.
265
+
<p>The <code>GeonamesProvider</code>named <code>geonames</code>is able to geocode and reverse geocode <strong>places</strong>.
263
266
A valid username is required.</p>
264
267
268
+
<h3>IpGeoBaseProvider</h3>
269
+
270
+
<p>The <code>IpGeoBaseProvider</code> named <code>ip_geo_base</code> is able to geocode <strong>IPv4 addresses</strong> only, very accurate in Russia.</p>
271
+
272
+
<h3>BaiduProvider</h3>
273
+
274
+
<p>The <code>BaiduProvider</code> named <code>baidu</code> is able to geocode and reverse geocode <strong>street addresses</strong>, exclusively in China.
275
+
A valid api key is required.</p>
276
+
277
+
<h3>Using The Providers</h3>
278
+
265
279
<p>You can use one of them or write your own provider. You can also register all providers and decide later.
266
280
That's we'll do:</p>
267
281
@@ -287,13 +301,20 @@ <h3>GeonamesProvider</h3>
287
301
<spanclass="p">));</span>
288
302
</pre></div>
289
303
290
-
<p>The <code>$locale</code> parameter is available for <code>YahooProvider</code>, <code>YandexProvider</code> and <code>BingMapsProvider</code>.<br>
291
-
The <code>$region</code> parameter is available for <code>GoogleMapsProvider</code> and <code>GoogleMapsBusinessProvider</code>.<br>
292
-
The <code>$toponym</code> parameter is available for <code>YandexProvider</code>.<br>
293
-
The <code>$service</code> parameter is available for <code>MaxMindProvider</code>.<br>
294
-
The <code>$useSsl</code> parameter is available for <code>GoogleMapsProvider</code>, <code>GoogleMapsBusinessProvider</code> and <code>MaxMindProvider</code>.</p>
304
+
<p>Parameters:</p>
295
305
296
-
<p>Everything is ok, enjoy!</p>
306
+
<ul>
307
+
<li>
308
+
<code>$locale</code> is available for <code>YahooProvider</code>, <code>YandexProvider</code> and <code>BingMapsProvider</code>.</li>
309
+
<li>
310
+
<code>$region</code> is available for <code>GoogleMapsProvider</code> and <code>GoogleMapsBusinessProvider</code>.</li>
311
+
<li>
312
+
<code>$toponym</code> is available for <code>YandexProvider</code>.</li>
313
+
<li>
314
+
<code>$service</code> is available for <code>MaxMindProvider</code>.</li>
315
+
<li>
316
+
<code>$useSsl</code> is available for <code>GoogleMapsProvider</code>, <code>GoogleMapsBusinessProvider</code> and <code>MaxMindProvider</code>.</li>
317
+
</ul><p>Everything is ok, enjoy!</p>
297
318
298
319
<h2>API</h2>
299
320
@@ -394,8 +415,9 @@ <h2>API</h2>
394
415
<spanclass="p">;</span>
395
416
</pre></div>
396
417
397
-
<p>The <code>using()</code> method allows you to choose the <code>provider</code> to use. When you deal with multiple providers, you may want to
398
-
choose one of them. The default behavior is to use the first one but it can be annoying.</p>
418
+
<p>The <code>using()</code> method allows you to choose the <code>provider</code> to use by its name.
419
+
When you deal with multiple providers, you may want to choose one of them.
420
+
The default behavior is to use the first one but it can be annoying.</p>
0 commit comments