2017 © Pedro Peláez
 

library geocoder

Barebones geocoder class using cUrl. Not a replacement for willdurand/geocoder

image

cartograf/geocoder

Barebones geocoder class using cUrl. Not a replacement for willdurand/geocoder

  • Thursday, October 5, 2017
  • by timstallmann
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

cartograf/geocoder

Latest Version on Packagist ![Software License][ico-license] ![Total Downloads][ico-downloads], (*1)

This is a bare-bones geocoding framework using cUrl to make http requests. I wrote it for myself as a utility class, mainly for geocoding from the command line., (*2)

It's intended to be easily extensible for custom geocoding APIs and to get out of the way as much as possible. willdurand/geocoder might be a better framework for you if you want something more robust or complex., (*3)

Install

Via Composer, (*4)

``` bash $ composer require cartograf/geocoder, (*5)


## Usage You'll need a class which extends the abstract `Geocoder` base class and defines the following methods: * `getQueryString(Address $address)` converts an `Address` into the portion of the query string which follows the `baseUrl`. Note that for now this needs to specify JSON output as well. * `getBaseUrl()` - defaults to `$this->baseUrl` if that is set via `setBaseUrl()` * `getLatLngFromResult(\stdClass $result)` consumes the json-decoded result object and returns an object with `latitude` and `longitude` properties. Note that this is the final return value so you could add other properties as well if you need them. Classes implementing MapQuest Nominatim (just set API key) and geocoding via an AWS EC2 instance of [Geolytica's geocoder](https://aws.amazon.com/marketplace/pp/B013CW6HOA) are included. ``` php $ch = curl_init() or die("curl_init failed"); $geocoder = new Cartograf\Geocoder($ch); echo $geocoder->geoCode($address); curl_close($ch);

Change log

Please see CHANGELOG for more information what has changed recently., (*6)

Testing

Not yet implemented., (*7)

bash $ composer test, (*8)

Contributing

Feel free to extend this and submit PRs! I welcome contributions., (*9)

Credits

License

The MIT License (MIT). Please see License File for more information., (*10)

The Versions

05/10 2017

dev-master

9999999-dev https://github.com/timstallmann/cartograf-geocoder

Barebones geocoder class using cUrl. Not a replacement for willdurand/geocoder

  Sources   Download

MIT

The Requires

  • php ~5.5|~7.0

 

The Development Requires

geocoder cartograf

05/10 2017

1.0.2

1.0.2.0 https://github.com/timstallmann/cartograf-geocoder

Barebones geocoder class using cUrl. Not a replacement for willdurand/geocoder

  Sources   Download

MIT

The Requires

  • php ~5.5|~7.0

 

The Development Requires

geocoder cartograf

02/12 2016

1.0.1

1.0.1.0 https://github.com/timstallmann/cartograf-geocoder

Barebones geocoder class using cUrl. Not a replacement for willdurand/geocoder

  Sources   Download

MIT

The Requires

  • php ~5.5|~7.0

 

The Development Requires

geocoder cartograf

12/09 2016

1.0.0

1.0.0.0 https://github.com/timstallmann/cartograf-geocoder

Barebones geocoder class using cUrl. Not a replacement for willdurand/geocoder

  Sources   Download

MIT

The Requires

  • php ~5.5|~7.0

 

The Development Requires

geocoder cartograf