Code Monkey home page Code Monkey logo

geocoder's Introduction

Geocoder

Geocoder Software License

Important: You are browsing the documentation of Geocoder 4.x.

Documentation for version 3.x is available here: Geocoder 3.x documentation.

Documentation for version 2.x is available here: Geocoder 2.x documentation.


Geocoder is a PHP library which helps you build geo-aware applications by providing a powerful abstraction layer for geocoding manipulations.

Installation

To install a Geocoder there are two things you need to know:

  1. What Geocoder provider you want to use
  2. What HTTP client/adapter you want to use.

Geocoder providers

Since 4.0 we do not include providers by default. You need to select a geocoder provider. You will see a list of providers at Packagist

HTTP Clients

In order to talk to geocoding APIs, you need HTTP adapters. While it was part of the library in Geocoder before, Geocoder 4.x and upper now relies on PSR-18 which defines how HTTP message should be sent and received. You can use any library to send HTTP messages that implements psr/http-client-implementation.

Read more about PSR-18 in this blog.

Summary (Just give me the command)

To install Google Maps geocoder with Guzzle 7 you may run the following command:

composer require geocoder-php/google-maps-provider guzzlehttp/guzzle

Or using the curl client (you'll need to provide a PSR7 implementation such as nyholm/psr7 if not using Guzzle)

composer require geocoder-php/google-maps-provider php-http/curl-client nyholm/psr7

Framework integration

If you are using a framework then you may be interested in our excellent framework integrations.

Framework Package Stats
Laravel geocoder-php/GeocoderLaravel GitHub release Packagist
Symfony geocoder-php/BazingaGeocoderBundle Latest Stable Version Total Downloads

Cookbook

We have a small cookbook where you can find examples on common use cases:

Usage

In the code snippet below we use GoogleMaps and Guzzle 7.

use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;

$httpClient = new \GuzzleHttp\Client();
$provider = new \Geocoder\Provider\GoogleMaps\GoogleMaps($httpClient, null, 'your-api-key');
$geocoder = new \Geocoder\StatefulGeocoder($provider, 'en');

$result = $geocoder->geocodeQuery(GeocodeQuery::create('Buckingham Palace, London'));
$result = $geocoder->reverseQuery(ReverseQuery::fromCoordinates(...));

The Provider interface has three methods:

  • geocodeQuery(GeocodeQuery $query):AddressCollection
  • reverseQuery(ReverseQuery $query):AddressCollection
  • getName():string

The Geocoder interface extends the Provider interface and exposes two additional methods. They will make migration from 3.x smoother.

  • geocode($streetOrIpAddress)
  • reverse($latitude, $longitude)

Providers

Providers perform the geocoding black magic for you (talking to the APIs, fetching results, dealing with errors, etc.) and are highly configurable.

Special providers

Provider Package Features Stats
Cache geocoder-php/cache-provider Wraps a provider and cached the results Latest Stable Version
Total Downloads
Chain geocoder-php/chain-provider Iterates over multiple providers Latest Stable Version
Total Downloads

Address

World

Provider Package Features Stats
Algolia Places geocoder-php/algolia-places-provider address
Website
Latest Stable Version
Total Downloads
ArcGIS Online geocoder-php/arcgis-online-provider address, reverse
Website
Latest Stable Version
Total Downloads
Azure Maps geocoder-php/azure-maps-provider address, reverse
Website
Latest Stable Version
Total Downloads
Bing Maps geocoder-php/bing-maps-provider address, reverse
Website
Latest Stable Version
Total Downloads
Geocode Earth geocoder-php/geocode-earth-provider address, reverse
Website
Latest Stable Version
Total Downloads
Geonames geocoder-php/geonames-provider address, reverse
Website
Latest Stable Version
Total Downloads
Google Maps
Google Maps for business
geocoder-php/google-maps-provider address, reverse
Website
Latest Stable Version
Total Downloads
Google Maps Places geocoder-php/google-maps-places-provider address, reverse
Website
Latest Stable Version
Total Downloads
GraphHopper geocoder-php/graphhopper-provider address, reverse
Website
Latest Stable Version
Total Downloads
Here geocoder-php/here-provider address, reverse
Website
Latest Stable Version
Total Downloads
LocationIQ geocoder-php/locationiq-provider address, reverse
Website
Latest Stable Version
Total Downloads
Mapbox geocoder-php/mapbox-provider address, reverse
Website
Latest Stable Version
Total Downloads
MapQuest geocoder-php/mapquest-provider address, reverse
Website
Latest Stable Version
Total Downloads
MapTiler geocoder-php/maptiler-provider address, reverse
Website
Latest Stable Version
Total Downloads
Nominatim
(OpenStreetMap)
geocoder-php/nominatim-provider address, reverse
Website
Latest Stable Version
Total Downloads
OpenCage geocoder-php/open-cage-provider address, reverse
Website
Latest Stable Version
Total Downloads
OpenRouteService geocoder-php/openrouteservice-provider address, reverse
Website
Latest Stable Version
Total Downloads
Pelias geocoder-php/pelias-provider address, reverse
Website
Latest Stable Version
Total Downloads
Photon geocoder-php/photon-provider address, reverse
Website
Latest Stable Version
Total Downloads
PickPoint geocoder-php/pickpoint-provider address, reverse
Website
Latest Stable Version
Total Downloads
TomTom geocoder-php/tomtom-provider address, reverse
Website
Latest Stable Version
Total Downloads
Yandex geocoder-php/yandex-provider address, reverse
Website
Latest Stable Version
Total Downloads

Local

Region Provider Package Features Stats
🇧🇪 bpost (third-party package*) geo6/geocoder-php-bpost-provider address
Website
Latest Stable Version
Total Downloads
🇧🇪 GeoPunt (third-party package*) geo6/geocoder-php-geopunt-provider address, reverse
Website
Latest Stable Version
Total Downloads
🇧🇪 Service Public de Wallonie (third-party package*) geo6/geocoder-php-spw-provider address, reverse
Website
Latest Stable Version
Total Downloads
🇧🇪 UrbIS (third-party package*) geo6/geocoder-php-urbis-provider address, reverse
Website
Latest Stable Version
Total Downloads
🇫🇷 Addok (third-party package*) geo6/geocoder-php-addok-provider address, reverse
Website
Latest Stable Version
Total Downloads
🇱🇺 Geoportail.lu (third-party package*) frantzmicccoli/geocoder-php-geoportail-lu address, reverse
Website
Latest Stable Version
Total Downloads
🇳🇱 Nationaal Georegister (third-party package*) swisnl/geocoder-php-nationaal-georegister-provider address, reverse
Website
Latest Stable Version
Total Downloads
🇷🇺 Sputnik (third-party package*) demollc/sputnik-provider address, reverse
Website
Latest Stable Version
Total Downloads

* Third-party package: Those providers are not official, i.e. not from the Geocoder core team.

IP

Provider Package Features Stats
FreeGeoIp geocoder-php/free-geoip-provider IPv4, IPv6
Website
Latest Stable Version
Total Downloads
GeoIP2 geocoder-php/geoip2-provider IPv4
Website
Latest Stable Version
Total Downloads
GeoPlugin geocoder-php/geo-plugin-provider IPv4, IPv6
Website
Latest Stable Version
Total Downloads
HostIp geocoder-php/host-ip-provider IPv4
Website
Latest Stable Version
Total Downloads
IP2Location geocoder-php/ip2location-provider IPv4, IPv6
Website
Latest Stable Version
Total Downloads
IP2Location Binary geocoder-php/ip2location-binary-provider IPv4, IPv6
Website
Latest Stable Version
Total Downloads
IpInfo geocoder-php/ip-info-provider IPv4, IPv6
Website
Latest Stable Version
Total Downloads
IpInfoDB geocoder-php/ip-info-db-provider IPv4
Website
Latest Stable Version
Total Downloads
ipstack geocoder-php/ipstack-provider IPv4, IPv6
Website
Latest Stable Version
Total Downloads
MaxMind geocoder-php/maxmind-provider IPv4, IPv6
Website
Latest Stable Version
Total Downloads
MaxMind Binary geocoder-php/maxmind-binary-provider IPv4, IPv6
Website
Latest Stable Version
Total Downloads

Other packages

There are two "abstract" or "base" packages that most providers depend on.

Name Package Features Stats
PHP common willdurand/geocoder Models, interfaces, exceptions etc Latest Stable Version
Total Downloads
HTTP common geocoder-php/common-http AbstractHttpProvider, HTTPlug Latest Stable Version
Total Downloads
Plugin geocoder-php/plugin Plugin provider Latest Stable Version
Total Downloads

Special Geocoders and Providers

The Chain Provider

The Chain provider is a special provider that takes a list of providers and iterates over this list to get information. Note that it stops its iteration when a provider returns a result. The result is returned by GoogleMaps because FreeGeoIp and HostIp cannot geocode street addresses. BingMaps is ignored.

use Geocoder\Query\GeocodeQuery;

$geocoder = new \Geocoder\ProviderAggregator();
$client  = new \GuzzleHttp\Client();

$chain = new \Geocoder\Provider\Chain\Chain([
    new \Geocoder\Provider\FreeGeoIp\FreeGeoIp($client),
    new \Geocoder\Provider\HostIp\HostIp($client),
    new \Geocoder\Provider\GoogleMaps\GoogleMaps($client, 'France'),
    new \Geocoder\Provider\BingMaps\BingMaps($client, '<API_KEY>'),
    // ...
]);

$geocoder->registerProvider($chain);

$result = $geocoder->geocodeQuery(GeocodeQuery::create('10 rue Gambetta, Paris, France'));
var_export($result);

Everything is ok, enjoy!

The ProviderAggregator

The ProviderAggregator is used to register several providers so that you can decide which provider to use later on.

use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery;

$client  = new \GuzzleHttp\Client();
$geocoder = new \Geocoder\ProviderAggregator();

$geocoder->registerProviders([
    new \Geocoder\Provider\GoogleMaps\GoogleMaps($client),
    new \Geocoder\Provider\GoogleMaps\GoogleMapsBusiness($client, '<CLIENT_ID>'),
    new \Geocoder\Provider\Yandex\Yandex($client),
    new \Geocoder\Provider\MaxMind\MaxMind($client, '<MAXMIND_API_KEY>'),
    new \Geocoder\Provider\ArcGISOnline\ArcGISOnline($client),
]);

$geocoder->registerProvider(new \Geocoder\Provider\Nominatim\Nominatim($adapter, 'https://your.nominatim.server'));

$geocoder
    ->using('google_maps')
    ->geocodeQuery(GeocodeQuery::create( ... ));

$geocoder
    ->limit(10)
    ->reverseQuery(ReverseQuery::fromCoordinates($lat, $lng));

The ProviderAggregator's API is fluent, meaning you can write:

use Geocoder\Query\GeocodeQuery;

$locations = $geocoder
    ->registerProvider(new \My\Provider\Custom($adapter))
    ->using('custom')
    ->limit(10)
    ->geocodeQuery(GeocodeQuery::create( ... ));

The using() method allows you to choose the provider to use by its name. When you deal with multiple providers, you may want to choose one of them. The default behavior is to use the first one but it can be annoying.

The limit() method allows you to configure the maximum number of results being returned. Depending on the provider you may not get as many results as expected, it is a maximum limit, not the expected number of results.

TimedGeocoder

The TimedGeocoder class profiles each geocode and reverse call. So you can easily figure out how many time/memory was spent for each geocoder/reverse call.

use Geocoder\Query\GeocodeQuery;

// configure your provider
$provider = // ...

$stopwatch = new \Symfony\Component\Stopwatch\Stopwatch();
$geocoder = new \Geocoder\TimedGeocoder($provider, $stopwatch);

$geocoder->geocodeQuery(GeocodeQuery::create('Paris, France'));

// Now you can debug your application

We use the symfony/stopwatch component under the hood. Which means, if you use the Symfony framework the geocoder calls will appear in your timeline section in the Web Profiler.

StatefulGeocoder

The StatefulGeocoder class is great when you want your Geocoder to hold state. Say you want to configure locale, limit or bounds in runtime. The StatefulGeocoder will append these values on each query.

use Geocoder\Query\GeocodeQuery;

// configure your provider
$provider = // ...
$geocoder = new \Geocoder\StatefulGeocoder($provider);

$geocoder->setLocale('en');
$results = $geocoder->geocodeQuery(GeocodeQuery::create('London'));
echo $results->first()->getLocality(); // London

$geocoder->setLocale('es');
$results = $geocoder->geocodeQuery(GeocodeQuery::create('London'));
echo $results->first()->getLocality(); // Londres

Dumpers

Geocoder provides dumpers that aim to transform a Location object in standard formats.

GPS eXchange Format (GPX)

The GPS eXchange format is designed to share geolocated data like point of interests, tracks, ways, but also coordinates. Geocoder provides a dumper to convert a Location object in an GPX compliant format.

Assuming we got a $location object as seen previously:

$dumper = new \Geocoder\Dumper\Gpx();
$strGpx = $dumper->dump($location);

echo $strGpx;

It will display:

<gpx
    version="1.0"
    creator="Geocoder" version="1.0.1-dev"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.topografix.com/GPX/1/0"
    xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
    <bounds minlat="2.388911" minlon="48.863151" maxlat="2.388911" maxlon="48.863151"/>
    <wpt lat="48.8631507" lon="2.3889114">
        <name><![CDATA[Paris]]></name>
        <type><![CDATA[Address]]></type>
    </wpt>
</gpx>

GeoJSON

GeoJSON is a format for encoding a variety of geographic data structures.

GeoArray

Simple PHP array format for using with your own encoders.

Keyhole Markup Language (KML)

Keyhole Markup Language is an XML notation for expressing geographic annotation and visualization within Internet-based, two-dimensional maps and three-dimensional Earth browsers.

Well-Known Binary (WKB)

The Well-Known Binary (WKB) representation for geometric values is defined by the OpenGIS specification.

Well-Known Text (WKT)

Well-known text (WKT) is a text markup language for representing vector geometry objects on a map, spatial reference systems of spatial objects and transformations between spatial reference systems.

Formatters

A common use case is to print geocoded data. Thanks to the StringFormatter class, it's simple to format a Location object as a string:

// $location is an instance of Location
$formatter = new \Geocoder\Formatter\StringFormatter();

$formatter->format($location, '%S %n, %z %L');
// 'Badenerstrasse 120, 8001 Zuerich'

$formatter->format($location, '<p>%S %n, %z %L</p>');
// '<p>Badenerstrasse 120, 8001 Zuerich</p>'

Here is the mapping:

  • Street Number: %n
  • Street Name: %S
  • City (Locality): %L
  • City District (Sub-Locality): %D
  • Zipcode (Postal Code): %z
  • Admin Level Name: %A1, %A2, %A3, %A4, %A5
  • Admin Level Code: %a1, %a2, %a3, %a4, %a5
  • Country: %C
  • Country Code: %c
  • Timezone: %T

Versioning

Geocoder follows Semantic Versioning.

End Of Life

1.x

As of December 2014, branch 1.7 is not officially supported anymore, meaning major version 1 reached end of life. Last version is: 1.7.1.

2.x

As of December 2014, version 2.x is in a feature frozen state. All new features should be contributed to version 3.0 and upper. Last version is: 2.8.1.

Major version 2 will reach end of life on December 2015.

3.x

As of January 2017, version 3.x is in a feature frozen state. All new features should be contributed to version 4.0 and upper. Last version is: 3.3.2.

Major version 3 will reach end of life on October 2017.

Stable Version

Version 4.x is the current major stable version of Geocoder.

Next version

There is no new major version planned at this time.

Contributing

See CONTRIBUTING file.

Unit Tests

In order to run the test suite, install the development dependencies:

composer install --dev

Then, run the following command:

composer test

You'll obtain some skipped unit tests due to the need of API keys.

Rename the phpunit.xml.dist file to phpunit.xml, then uncomment the following lines and add your own API keys:

<php>
    <!-- <server name="IPINFODB_API_KEY" value="YOUR_API_KEY" /> -->
    <!-- <server name="BINGMAPS_API_KEY" value="YOUR_API_KEY" /> -->
    <!-- <server name="GEOIPS_API_KEY" value="YOUR_API_KEY" /> -->
    <!-- <server name="MAXMIND_API_KEY" value="YOUR_API_KEY" /> -->
    <!-- <server name="GEONAMES_USERNAME" value="YOUR_USERNAME" /> -->
    <!-- <server name="TOMTOM_MAP_KEY" value="YOUR_MAP_KEY" /> -->
    <!-- <server name="GOOGLE_GEOCODING_KEY" value="YOUR_GEOCODING_KEY" /> -->
    <!-- <server name="OPENCAGE_API_KEY" value="YOUR_API_KEY" /> -->
    <!-- <server name="PICKPOINT_API_KEY" value="YOUR_API_KEY" /> -->
    <!-- <server name="LOCATIONIQ_API_KEY" value="YOUR_API_KEY" /> -->
    <!-- <server name="IPSTACK_API_KEY" value="YOUR_API_KEY" /> -->
</php>

You're done.

Credits

License

Geocoder is released under the MIT License. See the bundled LICENSE file for details.

geocoder's People

Contributors

andrea-cristaudo avatar antoinelemaire avatar arubacao avatar atymic avatar baachi avatar chris53897 avatar dependabot[bot] avatar gelolabs avatar giosh94mhz avatar gpirrotta avatar gyndav avatar havvg avatar jbelien avatar jsor avatar makasim avatar mtmail avatar nicolas-grekas avatar norkunas avatar nyholm avatar ollietb avatar pyrech avatar ronanguilloux avatar stadly avatar svrdlic avatar themouette avatar toin0u avatar vicchi avatar warmans avatar willdurand avatar xabbuh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geocoder's Issues

Add a result object

The ->geocode() method should return an object, which implements the ArrayAccessInterface and has two methods : fromArray(), toArray().

We can name this object Result\Geocoded and we can do the same for the reverse() method (Result\Reversed).

There is nothing to invent as we just have to move the code in the `Geocoder class.

cc @themouette

William

Seperate to GeocoderIp and GeocoderAddress

Hello,

First I'm glad to see this project!

But I think I makes sense to seperate the two options "Geocode by Ip" and "Geocode by Address".

ATM there is only $geocoder->geocode($value)

Adding locale

It should be possible to specify a locale for both, normal and reverse lookups.

Use composer for autoloading

I think the current solution for autoload classes is very obscure.

We should use composer for autoloading. Composer can create automaticly a classmap.
For BC reasons i would create a closure to load the classes, if no composer is available. (Maybe with a warning)?

Adding more adapters

It may be useful to add new adapters like a CurlHttpAdapter or a FopenAdapter even if Buzz provides this kind of abstraction.

Unable To Retrieve Location from Lat , Long

Hello,

I'm trying to retrieve locations using latitude and longitude, but am currently receiving null.
I thought it might be to-do with some wrong lat & long coordinates, but I'm using the coordinates in the example of http://geocoder-php.org/ (top of the page), and am still receiving null.

So I've tried this
$result = $geocoder->reverse(44.9817,-93.2783);
//
and this
$result = $geocoder->geocode(44.9817,-93.2783);

I've also tried wrapping the coordinates in speech marks/apostrophes, to apply coordinates as strings.

I can however retrieve the location with an IP, using the example;
$result = $geocoder->geocode('68.145.37.34');

How to include/autoload geocoder into Zend

Hello!

Actually i'm trying to setup up the geocoder lib to work within our ZF application. Therefore i want to use the ZF autoloader function. But without the ZF compatible namespaces or class naming autloading of the classes, i'm not sure to do this.

Can you explain me how to autload the geocoder library in a ZF application. I added the src-folder locally to the folder:

"D:\Program Files (x86)\Zend\ZendServer\share\ZendFramework\library"

best regards

Would you be willing to dual license MIT / GPL?

Hi,

I'm one of the maintainers for the geocoder module for Drupal (an open-source content-management system). You can see the module page here: http://drupal.org/project/geocoder

We'd like to make extensive of your awesome Geocoder library in our project. Ideally we would like to distribute it packaged with our module, but given that Drupal is licensed under the GPLv2 and Geocoder library is licensed as MIT that is not currently possible. Would you be willing to dual-license your project as both GPLv2 and MIT? This would allow us to legally distribute it with our module.

FYI, jQuery is also dual-licensed MIT and GPLv2 (http://jquery.org/license/) so that it can be legally shipped with GPL projects.

Thank you for your consideration,

~Patrick Hayes

Adding reverse geocoding feature

Assuming you have coordinates, you may want to get information from them (street address actually).
It can be easily doable by changing the ProviderInterface:

  • Tweak the getData() method;
  • Adding a reverse() method.
  • Adding a reverse() method in the GeocoderInterface.

Class 'Buzz\Browser' not found

Hello,

I'm using Geocoder (http://geocoder-php.org/) in my application.
I've installed it using the steps provided on the website.

Problem:
When I run the application, I receive the error;
Fatal error: Class 'Buzz\Browser' not found in D:\xampp\htdocs\dmp\geocoder\src\Geocoder\HttpAdapter\BuzzHttpAdapter.php on line 31

Line 31:
-- code --
$this->browser = new Browser();
-- /code --

I have this in my autoload.php file;
-- code --

OpenStreetMapsProvider - Error

If $searchResult is not set on Line 53, the whole foreach does not work and on line 63 it will throw a fatal error:

Fatal error: Call to a member function getAttribute() on a non-object in /***/vendor/Geocoder/src/Geocoder/Provider/OpenStreetMapsProvider.php on line 63

Add local adapter

It some use cases, a locale database would be usefull.

e.g.:
Your project use the YahooPlaceFinder provider. You'r requests are limited from Yahoo!.
If your limit is reached, it will throw some error's - that's bad.

Solution:
You create a Fallback provider that wrap the YahooPlaceFinder provider and the Locale provider.

  1. Geocoder ask the Fallback provider.
  2. The Fallback provider ask in first place the YahooProvider.
  3. If the request fails, the fallback ask the Locale provider.

Notice error Bing Provider

gecoding of "Hannover" (city in Germany) causes notice error:

Notice: Undefined property: stdClass::$postalCode
Notice: Undefined property: stdClass::$adminDistrict2

Need to check with property_exists

Caching

Perhaps beyond the scope of the project, but I think it would be useful to make for a fully featured geocoder, pretty much all other aspects are already covered.

I quite like the implementation in https://github.com/dsyph3r/GoogleGeolocationBundle, something similar with an additional field in the log for whichever provider was used, and uniqueness of search based off the values inputted and provider used:

CREATE TABLE `geolocation_location` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `search` varchar(255) NOT NULL,
  `provider` varchar(255) NOT NULL,
  `matches` smallint(6) NOT NULL,
  `status` varchar(20) NOT NULL,
  `result` longtext NOT NULL,
  `hits` int(11) NOT NULL,
  `created` datetime NOT NULL,
  `updated` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=latin1;

NB: He has also implemented a generic API log, which may also be useful:

CREATE TABLE `geolocation_api_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `lastStatus` varchar(20) NOT NULL,
  `requests` int(11) NOT NULL,
  `created` date NOT NULL,
  `updated` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNIQ_26CE10BDB23DB7B8` (`created`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

Syntax error install_vendors.sh

I got a syntax error in file install_vendors.sh

markus@development:/var/www/geocoder/Geocoder$ sh ./bin/install_vendors.sh
: not foundll_vendors.sh: 2:
./bin/install_vendors.sh: 3: function: not found
: not foundll_vendors.sh: 4: {
Installing/Updating
: not foundll_vendors.sh: 6:
./bin/install_vendors.sh: 30: Syntax error: end of file unexpected (expecting "then")

Add getRawData() method somewhere

It could be nice to provide a getRawData() method somewhere so that people can use raw data to get extra information.
It should probably be located in the providers as they already contain raw data.

Refactoring providers

I'm not really fan of my implementation of providers, especially since reverse geocoding has been added.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.