Download the PHP package cartograf/geocoder without Composer
On this page you can find all versions of the php package cartograf/geocoder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cartograf/geocoder
More information about cartograf/geocoder
Files in cartograf/geocoder
Package geocoder
Short Description Barebones geocoder class using cUrl. Not a replacement for willdurand/geocoder
License MIT
Homepage https://github.com/timstallmann/cartograf-geocoder
Informations about the package geocoder
cartograf/geocoder
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.
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.
Install
Via Composer
Usage
You'll need a class which extends the abstract Geocoder
base class and defines the following methods:
getQueryString(Address $address)
converts anAddress
into the portion of the query string which follows thebaseUrl
. Note that for now this needs to specify JSON output as well.getBaseUrl()
- defaults to$this->baseUrl
if that is set viasetBaseUrl()
getLatLngFromResult(\stdClass $result)
consumes the json-decoded result object and returns an object withlatitude
andlongitude
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 are included.
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
Not yet implemented.
Contributing
Feel free to extend this and submit PRs! I welcome contributions.
Credits
License
The MIT License (MIT). Please see License File for more information.