Geonames Bundle

Symfony 2 Geonames Bundle for nikkobautista library

View project on GitHub

1. Installation:

Add this to composer.json

"stev/geonames-bundle": "0.1.*@dev"

Add this to app/config/AppKernel.php

new Stev\GeonamesBundle\StevGeonamesBundle()

Default configs:

stev_geonames:
    username: your_username
    token: ~
    use_public: true

2. Usage

/* @var $geonames \Geonames\Geonames */
$geonames = $this->get('stev.geonames')->getGeonames();
$result = $geonames->findNearbyPostalCodes(array(
     'postalcode' => 712122
 ));

3. Endpoints

A list of full endpoints can be found in the library https://github.com/nikkobautista/geonames, or on Geonames website http://www.geonames.org/export/ws-overview.html