All Projects → Aternus → geonames-client

Aternus / geonames-client

Licence: MIT license
GeoNames API Client

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to geonames-client

geonamescache
geonamescache - a Python library for quick access to a subset of GeoNames data.
Stars: ✭ 76 (+137.5%)
Mutual labels:  geonames, countries
geode
🌎 wrapper for www.geonames.org written in javascript as a node module
Stars: ✭ 57 (+78.13%)
Mutual labels:  geonames
Factbook
factbook gem - scripts for the world factbook (get open structured data e.g JSON etc.)
Stars: ✭ 121 (+278.13%)
Mutual labels:  countries
Awesome Startups
❤️ A curated list of awesome startups
Stars: ✭ 197 (+515.63%)
Mutual labels:  countries
Circle Flags
A collection of 300+ minimal circular SVG country flags
Stars: ✭ 139 (+334.38%)
Mutual labels:  countries
Laravel cities
Find any country/city in the world. Get Long/Lat etc. Deploy geonames.org database localy. Optimized DB tree
Stars: ✭ 133 (+315.63%)
Mutual labels:  countries
Countries
Collection of Country Information for Elixir.
Stars: ✭ 107 (+234.38%)
Mutual labels:  countries
WhatsMissingInGeoparsing
The accompanying code and data for the Springer 2017 publication "What's missing in geographical parsing?" in Language Resources and Evaluation.
Stars: ✭ 15 (-53.12%)
Mutual labels:  geonames
CLAVIN-NERD
Stanford NLP Implementation of the CLAVIN LocationTagger
Stars: ✭ 22 (-31.25%)
Mutual labels:  geonames
Countrycode
🎯 Swift country and phone code Picker
Stars: ✭ 175 (+446.88%)
Mutual labels:  countries
Mapsicon
A free collection of maps for every country in the world, available in 11 sizes or in SVG.
Stars: ✭ 1,999 (+6146.88%)
Mutual labels:  countries
Translatr
💬 Translate to multiple languages at once
Stars: ✭ 145 (+353.13%)
Mutual labels:  countries
local-reverse-geocoder
Local reverse geocoder for Node.js based on GeoNames data
Stars: ✭ 155 (+384.38%)
Mutual labels:  geonames
lucene-geo-gazetteer
Uses Apache Lucene, OpenNLP and geonames and extracts locations from text and geocodes them.
Stars: ✭ 34 (+6.25%)
Mutual labels:  geonames
Restcountries
Get information about countries via a RESTful API
Stars: ✭ 2,054 (+6318.75%)
Mutual labels:  countries
Countries
Laravel countries and currencies
Stars: ✭ 1,564 (+4787.5%)
Mutual labels:  countries
Country Region Data
A source list of countries, regions and shortcodes in JSON and JS format.
Stars: ✭ 222 (+593.75%)
Mutual labels:  countries
Xponents
Geographic Place, Date/time, and Pattern entity extraction toolkit along with text extraction from unstructured data and GIS outputters.
Stars: ✭ 39 (+21.88%)
Mutual labels:  geonames
EpiTator
EpiTator annotates epidemiological information in text documents. It is the natural language processing framework that powers GRITS and EIDR Connect.
Stars: ✭ 38 (+18.75%)
Mutual labels:  geonames
CLAVIN-rest
A Spring Boot microservice that serves the CLAVIN (https://github.com/novetta/CLAVIN) library for geo rectifying locations mentioned in text.
Stars: ✭ 16 (-50%)
Mutual labels:  geonames

GeoNames Client

A GeoNames API Client for PHP.

Quick Start

An overview of available API parameters for each endpoint is available here.

<?php

use GeoNames\Client as GeoNamesClient;

$g = new GeoNamesClient('username');

// get a list of supported endpoints
$endpoints = $g->getSupportedEndpoints();

// get info for country
// note that I'm using the array destructor introduced in PHP 7.1
[$country] = $g->countryInfo([
    'country' => 'IL',
    'lang'    => 'ru', // display info in Russian
]);

// country name (in Russian)
$country_name = $country->countryName;

// spoken languages (ISO-639-1)
$country_languages = $country->languages;

Why?

This library will allow you to get better insights into the world.

As a developer and a multi-lingual speaker I've always felt that localization was put on last priority since it was so time consuming and error-prone.

Getting statistics for each country is a painful process that requires understanding the different ISO standards, and even then you're still left to piece the puzzle together yourself.

Luckily, GeoNames have been collecting statistical data about the world for the past few decades and offers that data via their API.

The aim of this library is to provide a single source of truth for country (ISO-3166), language (ISO-639-1), and other locale related statistical data, so that other developers can write better software which is up-to-date with the latest changes in the world.

Installation

If you're using Composer to manage dependencies:

composer require aternus/geonames-client

Then, after running composer update, you can load the class using Composer's autoloading:

require 'vendor/autoload.php';

Otherwise, you can simply require the file directly:

require_once 'vendor/aternus/geonames-client/src/Client.php';

And in either case, I'd suggest using an alias.

use GeoNames\Client as GeoNamesClient;

Other Useful Libraries

Please make sure to implement some kind of a cache mechanism in order to save yourself time, bandwidth and be respectful to GeoNames for providing all that data for free.

If you're making heavy use of the statistical data, you can subscribe to the their Premium Data plan.

License

Released under the MIT License - see LICENSE.md for details.

Credits

David Jean Louis for the PEAR package which inspired this GeoNames API Client.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].