Skip to content

Commit 0e84a04

Browse files
committed
update README
1 parent 7675cc2 commit 0e84a04

File tree

1 file changed

+69
-70
lines changed

1 file changed

+69
-70
lines changed

README.md

Lines changed: 69 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Nominatim | yes | supported | worldwide | requires a domain name (e.g. local
4242
[Geonames](http://www.geonames.org/commercial-webservices.html) | yes |no | worldwide | requires registration, no free tier
4343
[TomTom](https://geocoder.tomtom.com/app/view/index) | yes | required | worldwide | requires API key. First 2500 requests or 30 days free
4444
[ArcGIS Online](https://developers.arcgis.com/en/features/geocoding/) | yes | supported | worldwide | requires API key. 1250 requests free
45-
ChainProvider | | | | meta provider which iterates over a list of providers
45+
Chain | | | | meta provider which iterates over a list of providers
4646

4747

4848
IP-based geocoding
@@ -115,118 +115,118 @@ $adapter = new \Geocoder\HttpAdapter\BuzzHttpAdapter($buzz);
115115
Now, you have to choose a `provider` which is closed to what you want to get.
116116

117117

118-
### FreeGeoIpProvider ###
118+
### FreeGeoIp ###
119119

120-
The `FreeGeoIpProvider` named `free_geo_ip` is able to geocode **IPv4 and IPv6
120+
The `FreeGeoIp` named `free_geo_ip` is able to geocode **IPv4 and IPv6
121121
addresses** only.
122122

123123

124-
### HostIpProvider ###
124+
### HostIp ###
125125

126-
The `HostIpProvider` named `host_ip` is able to geocode **IPv4 addresses** only.
126+
The `HostIp` named `host_ip` is able to geocode **IPv4 addresses** only.
127127

128128

129-
### IpInfoDbProvider ###
129+
### IpInfoDb ###
130130

131-
The `IpInfoDbProvider` named `ip_info_db` is able to geocode **IPv4 addresses**
131+
The `IpInfoDb` named `ip_info_db` is able to geocode **IPv4 addresses**
132132
only. A valid api key is required.
133133

134134

135-
### GoogleMapsProvider ###
135+
### GoogleMaps ###
136136

137-
The `GoogleMapsProvider` named `google_maps` is able to geocode and reverse
137+
The `GoogleMaps` named `google_maps` is able to geocode and reverse
138138
geocode **street addresses**. A locale and a region can be set as well as an
139139
optional api key. This provider also supports SSL.
140140

141141

142-
### GoogleMapsBusinessProvider ###
142+
### GoogleMapsBusiness ###
143143

144-
The `GoogleMapsBusinessProvider` named `google_maps_business` is able to geocode
144+
The `GoogleMapsBusiness` named `google_maps_business` is able to geocode
145145
and reverse geocode **street addresses**. A valid `Client ID` is required. The
146146
private key is optional. This provider also supports SSL.
147147

148148

149-
### BingMapsProvider ###
149+
### BingMaps ###
150150

151-
The `BingMapsProvider` named `bing_maps` is able to geocode and reverse geocode
151+
The `BingMaps` named `bing_maps` is able to geocode and reverse geocode
152152
**street addresses**. A valid api key is required.
153153

154154

155-
### OpenStreetMapProvider ###
155+
### OpenStreetMap ###
156156

157-
The `OpenStreetMapProvider` named `openstreetmap` is able to geocode and reverse
157+
The `OpenStreetMap` named `openstreetmap` is able to geocode and reverse
158158
geocode **street addresses**.
159159

160160

161-
### NominatimProvider ###
161+
### Nominatim ###
162162

163-
The `NominatimProvider` named `nominatim` is able to geocode and reverse geocode
163+
The `Nominatim` named `nominatim` is able to geocode and reverse geocode
164164
**street addresses**. Access to a Nominatim server is required. See the
165165
[Nominatim Wiki Page](http://wiki.openstreetmap.org/wiki/Nominatim) for more
166166
information.
167167

168168

169-
### GeoipProvider ###
169+
### Geoip ###
170170

171-
The `GeoipProvider` named `geoip` is able to geocode **IPv4 and IPv6 addresses**
171+
The `Geoip` named `geoip` is able to geocode **IPv4 and IPv6 addresses**
172172
only. No need to use an `HttpAdapter` as it uses a local database. See the
173173
[MaxMind page](http://www.maxmind.com/app/php) for more information.
174174

175175

176-
### ChainProvider ###
176+
### Chain ###
177177

178-
The `ChainProvider` named `chain` is a special provider that takes a list of
178+
The `Chain` named `chain` is a special provider that takes a list of
179179
providers and iterates over this list to get information.
180180

181181

182-
### MapQuestProvider ###
182+
### MapQuest ###
183183

184-
The `MapQuestProvider` named `map_quest` is able to geocode and reverse geocode
184+
The `MapQuest` named `map_quest` is able to geocode and reverse geocode
185185
**street addresses**. A valid api key is required. Access to [MapQuest's
186186
licensed
187187
endpoints](http://developer.mapquest.com/web/tools/getting-started/platform/licensed-vs-open)
188188
is provided via constructor argument.
189189

190190

191-
### OpenCageProvider ###
191+
### OpenCage ###
192192

193-
The `OpenCageProvider` named `opencage` is able to geocode and reverse geocode
193+
The `OpenCage` named `opencage` is able to geocode and reverse geocode
194194
**street addresses**. A valid api key is required.
195195

196196

197-
### YandexProvider ###
197+
### Yandex ###
198198

199-
The `YandexProvider` named `yandex` is able to geocode and reverse geocode
199+
The `Yandex` named `yandex` is able to geocode and reverse geocode
200200
**street addresses**. The default language-locale is `ru-RU`, you can choose
201201
between `uk-UA`, `be-BY`, `en-US`, `en-BR` and `tr-TR`. This provider can also
202202
reverse information based on coordinates (latitude, longitude). It's possible to
203203
precise the toponym to get more accurate result for reverse geocoding: `house`,
204204
`street`, `metro`, `district` and `locality`.
205205

206206

207-
### GeoPluginProvider ###
207+
### GeoPlugin ###
208208

209-
The `GeoPluginProvider` named `geo_plugin` is able to geocode **IPv4 addresses
209+
The `GeoPlugin` named `geo_plugin` is able to geocode **IPv4 addresses
210210
and IPv6 addresses** only.
211211

212212

213-
### GeoIPsProvider ###
213+
### GeoIPs ###
214214

215-
The `GeoIPsProvider` named `geo_ips` is able to geocode **IPv4 addresses** only.
215+
The `GeoIPs` named `geo_ips` is able to geocode **IPv4 addresses** only.
216216
A valid api key is required.
217217

218218

219-
### MaxMindProvider ###
219+
### MaxMind ###
220220

221-
The `MaxMindProvider` named `maxmind` is able to geocode **IPv4 and IPv6
221+
The `MaxMind` named `maxmind` is able to geocode **IPv4 and IPv6
222222
addresses** only. A valid `City/ISP/Org` or `Omni` service's api key is
223223
required. This provider provides two constants `CITY_EXTENDED_SERVICE` by
224224
default and `OMNI_SERVICE`.
225225

226226

227-
### MaxMindBinaryProvider ###
227+
### MaxMindBinary ###
228228

229-
The `MaxMindBinaryProvider` named `maxmind_binary` is able to geocode **IPv4 and
229+
The `MaxMindBinary` named `maxmind_binary` is able to geocode **IPv4 and
230230
IPv6 addresses** only. It requires a data file, and the
231231
[geoip/geoip](https://packagist.org/packages/geoip/geoip) package must be
232232
installed.
@@ -235,16 +235,16 @@ It is worth mentioning that this provider has **serious performance issues**,
235235
and should **not** be used in production. For more information, please read
236236
[issue #301](https://github.com/geocoder-php/Geocoder/issues/301).
237237

238-
### GeoIP2DatabaseProvider ###
238+
### GeoIP2Database ###
239239

240-
The `GeoIP2Provider` named `maxmind_geoip2` is able to geocode **IPv4 and IPv6
240+
The `GeoIP2` named `maxmind_geoip2` is able to geocode **IPv4 and IPv6
241241
addresses** only - it makes use of the MaxMind GeoIP2 databases or the
242242
webservice.
243243

244244
It requires either the [database
245245
file](http://dev.maxmind.com/geoip/geoip2/geolite2/), or the
246246
[webservice](http://dev.maxmind.com/geoip/geoip2/web-services/) - represented by
247-
the GeoIP2 Provider, which is injected to the `GeoIP2Adapter`. The
247+
the GeoIP2 , which is injected to the `GeoIP2Adapter`. The
248248
[geoip2/geoip2](https://packagist.org/packages/geoip2/geoip2) package must be
249249
installed.
250250

@@ -259,27 +259,27 @@ This provider will only work with the corresponding `GeoIP2Adapter`.
259259
$reader = new \GeoIp2\Database\Reader('/path/to/database');
260260

261261
$adapter = new \Geocoder\HttpAdapter\GeoIP2Adapter($reader);
262-
$provider = new \Geocoder\Provider\GeoIP2Provider($adapter);
262+
$provider = new \Geocoder\Provider\GeoIP2($adapter);
263263
$geocoder = new \Geocoder\Geocoder($provider);
264264

265265
$address = $geocoder->geocode('74.200.247.59');
266266
```
267267

268-
### GeonamesProvider ###
268+
### Geonames ###
269269

270-
The `GeonamesProvider` named `geonames` is able to geocode and reverse geocode
270+
The `Geonames` named `geonames` is able to geocode and reverse geocode
271271
**places**. A valid username is required.
272272

273-
### TomTomProvider ###
273+
### TomTom ###
274274

275-
The `TomTomProvider` named `tomtom` is able to geocode and reverse geocode
275+
The `TomTom` named `tomtom` is able to geocode and reverse geocode
276276
**street addresses**. The default langage-locale is `en`, you can choose
277277
between `de`, `es`, `fr`, `it`, `nl`, `pl`, `pt` and `sv`. A valid api key is
278278
required.
279279

280-
### ArcGISOnlineProvider ###
280+
### ArcGISOnline ###
281281

282-
The `ArcGISOnlineProvider` named `arcgis_online` is able to geocode and reverse
282+
The `ArcGISOnline` named `arcgis_online` is able to geocode and reverse
283283
geocode **street addresses**. It's possible to specify a sourceCountry to
284284
restrict result to this specific country thus reducing request time (note that
285285
this doesn't work on reverse geocoding). This provider also supports SSL.
@@ -295,56 +295,55 @@ providers and decide later. That's we'll do:
295295

296296
$geocoder = new \Geocoder\ProviderBasedGeocoder();
297297
$geocoder->registerProviders(array(
298-
new \Geocoder\Provider\GoogleMapsProvider(
298+
new \Geocoder\Provider\GoogleMaps(
299299
$adapter, $locale, $region, $useSsl
300300
),
301-
new \Geocoder\Provider\GoogleMapsBusinessProvider(
301+
new \Geocoder\Provider\GoogleMapsBusiness(
302302
$adapter, '<CLIENT_ID>', '<PRIVATE_KEY>', $locale, $region, $useSsl
303303
),
304-
new \Geocoder\Provider\YandexProvider(
304+
new \Geocoder\Provider\Yandex(
305305
$adapter, $locale, $toponym
306306
),
307-
new \Geocoder\Provider\MaxMindProvider(
307+
new \Geocoder\Provider\MaxMind(
308308
$adapter, '<MAXMIND_API_KEY>', $service, $useSsl
309309
),
310-
new \Geocoder\Provider\ArcGISOnlineProvider(
310+
new \Geocoder\Provider\ArcGISOnline(
311311
$adapter, $sourceCountry, $useSsl
312312
),
313-
new \Geocoder\Provider\NominatimProvider(
313+
new \Geocoder\Provider\Nominatim(
314314
$adapter, 'http://your.nominatim.server', $locale
315315
),
316316
));
317317
```
318318

319319
Parameters:
320320

321-
* `$locale` is available for `YandexProvider`, `BingMapsProvider`,
322-
`OpenCageProvider` and `TomTomProvider`
323-
* `$region` is available for `GoogleMapsProvider` and
324-
`GoogleMapsBusinessProvider`
325-
* `$toponym` is available for `YandexProvider`
326-
* `$service` is available for `MaxMindProvider`
327-
* `$useSsl` is available for `GoogleMapsProvider`, `GoogleMapsBusinessProvider`,
328-
`OpenCageProvider`, `MaxMindProvider` and `ArcGISOnlineProvider`
329-
* `$sourceCountry` is available for `ArcGISOnlineProvider`
330-
* `$rootUrl` is available for `NominatimProvider`
321+
* `$locale` is available for `Yandex`, `BingMaps`,
322+
`OpenCage` and `TomTom`
323+
* `$region` is available for `GoogleMaps` and
324+
`GoogleMapsBusiness`
325+
* `$toponym` is available for `Yandex`
326+
* `$service` is available for `MaxMind`
327+
* `$useSsl` is available for `GoogleMaps`, `GoogleMapsBusiness`,
328+
`OpenCage`, `MaxMind` and `ArcGISOnline`
329+
* `$sourceCountry` is available for `ArcGISOnline`
330+
* `$rootUrl` is available for `Nominatim`
331331

332-
### Using The ChainProvider ###
332+
### Using The Chain Provider ###
333333

334334
As said it's a special provider that takes a list of providers and iterates over
335335
this list to get information. Note that it **stops** its iteration when a
336-
provider returns a result. The result is returned by `GoogleMapsProvider`
337-
because `FreeGeoIpProvider` and `HostIpProvider` cannot geocode street
338-
addresses. `BingMapsProvider` is ignored.
336+
provider returns a result. The result is returned by `GoogleMaps` because
337+
`FreeGeoIp` and `HostIp` cannot geocode street addresses. `BingMaps` is ignored.
339338

340339
``` php
341340
$geocoder = new \Geocoder\ProviderBasedGeocoder();
342341
$adapter = new \Geocoder\HttpAdapter\CurlHttpAdapter();
343-
$chain = new \Geocoder\Provider\ChainProvider(array(
344-
new \Geocoder\Provider\FreeGeoIpProvider($adapter),
345-
new \Geocoder\Provider\HostIpProvider($adapter),
346-
new \Geocoder\Provider\GoogleMapsProvider($adapter, 'fr_FR', 'France', true),
347-
new \Geocoder\Provider\BingMapsProvider($adapter, '<API_KEY>'),
342+
$chain = new \Geocoder\Provider\Chain(array(
343+
new \Geocoder\Provider\FreeGeoIp($adapter),
344+
new \Geocoder\Provider\HostIp($adapter),
345+
new \Geocoder\Provider\GoogleMaps($adapter, 'fr_FR', 'France', true),
346+
new \Geocoder\Provider\BingMaps($adapter, '<API_KEY>'),
348347
// ...
349348
));
350349
$geocoder->registerProvider($chain);

0 commit comments

Comments
 (0)