PHP Classes

GeoNames PHP API: Search for geographic places using GeoNames API

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 74 All time: 10,213 This week: 455Up
Version License PHP version Categories
geo-name-search 1.0GNU General Publi...5PHP 5, Searching, Web services, Geogr...
Description 

Author

This class can search for geographic places using GeoNames API.

It can send HTTP requests to the GeoNames API Web server to perform searches for geographic locations.

Currently, it can retrieve the:

- States of a given country

- Cities with a given name

The class can cache the query results to avoid calling the GeoNames API multiple times to query the same information.

Picture of Ujah Chigozie peter
  Performance   Level  
Name: Ujah Chigozie peter <contact>
Classes: 28 packages by
Country: Nigeria Nigeria
Age: 33
All time rank: 198810 in Nigeria Nigeria
Week rank: 10 Up1 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 11x

Documentation

geo-name-search

Php Geoname search wrapper, to help reduce too much api call

Installation

Installation is super-easy via Composer:

composer require peterujah/geo-name-search

USAGES

First you have to create an account with geoname to acquire api username http://www.geonames.org/export/geonames-search.html

Initialize GeoNameSearch with geoname api username

$geo = new \Peterujah\NanoBlock\GeoNameSearch("username");

List all states in any country Nigeria

$geo->states("Nigeria");

List all cities in any sates Enugu

$geo->cities("Enugu");

Search geoname with query and country

$geo->query("Query", "Country");

  Files folder image Files (4)  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (4)  /  src  
File Role Description
  Plain text file GeoNameSearch.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:74
This week:0
All time:10,213
This week:455Up