📜 ⬆️ ⬇️

Geography package: ready to go

Work on the creation began in May , in July there was a good working version, and now in December we have:


Our goal is very simple - to become a standard open-source library of geographic data (administrative divisions and titles). There is nothing like that today, each developer has to reinvent the wheel.

In short, the main advantage of using the Geographer library is the ability to do something like:

use MenaraSolutions\Geographer\State; $voronezh = State::build('RU-VOR'); echo "  {$voronezh->getName('ru')}\n"; echo "  {$voronezh->inflict('in')->getName()}\n"; echo "  {$voronezh->inflict('from')->getName()}\n"; //     //      //      

If you think that this is very simple, then know that even giants like Facebook and VK still make it with errors! :)
')

Separating data from code


An important difference between the current version was the separation of repositories - JSON data is now stored as a separate package, which allows the use of content in other programming languages. In addition, corrections, for example, in Russian will be downloaded only by those who really need Russian (the package with the Russian language is installed in composer.json).

Ability to choose a standard


By default, Geographer uses the ISO 3166 system to divide by country and region. ISO is the only actively supported standard for today, so we recommend using it. However, the standard can be chosen:

 $country->setStandard(DefaultManager::STANDARD_ISO); // ISO $country->setStandard(DefaultManager::STANDARD_FIPS); // FIPS 10-4 $country->setStandard(DefaultManager::STANDARD_GEONAMES); // GeoNames 

Participation is welcome


We invite developers to participate! Geographer is a promising and useful package. Among the SDK priorities for Node.js and Ruby, as well as bringing the translation of cities in Russian to 100%.

Comments, criticism and any other feedback are also much appreciated.

Source: https://habr.com/ru/post/318424/


All Articles