Download the PHP package daveross/offline-country-reverse-geocoder without Composer
On this page you can find all versions of the php package daveross/offline-country-reverse-geocoder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download daveross/offline-country-reverse-geocoder
More information about daveross/offline-country-reverse-geocoder
Files in daveross/offline-country-reverse-geocoder
Package offline-country-reverse-geocoder
Short Description Determine which country a lat/long point falls in
License MIT
Informations about the package offline-country-reverse-geocoder
Offline Country Reverse Geocoder
Determine which country a latitude/longitude point falls in, returning an ISO 3166-1 two letter country code. All processing is done locally using a dataset of country borders without needing to connect to an API.
Uses the data file from https://github.com/bencampion/reverse-country-code
Installing
With Composer
or add the dependency to your composer.json file manually:
Without Composer
Copy this library's files to wherever you put third-party libraries in your application. Include src/offline-country-reverse-geocoder.php
from this library, and it'll load polygons.properties
from the same directory.
Examples
Dataset
This library uses the world borders dataset from thematicmapping.org. The data is stored in a properties file within the project that maps country codes to Well Known Text format polygons and multi-polygons. The dataset was converted to Well Known Text format by GIS Stack Exchange user, elrobis.
License
All code is MIT licensed
See why I contribute to open source software.
The data file src/polygons.properties is available under a Creative Commons Attribution-Share Alike License in accordance with the license from https://github.com/bencampion/reverse-country-code