Download .zip |
Info | Example | View files (3) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2019-01-13 (1 month ago) | Not yet rated by the users | Total: 53 This week: 3 | All time: 9,410 This week: 141 |
Version | License | PHP version | Categories | |||
pluscodelocal 1.0 | Public Domain | 5 | PHP 5, Geography |
Description | Author | |||
This class can get the location information from PlusCode. Innovation Award
|
Class PlusCodeLocal This static class extends the static class PlusCode, found here: https://www.phpclasses.org/package/11016 The class provides a single method, get() which takes as input a full Open Location Code and returns a string with a localized code. The philosophy of the Google PlusCode address is that it "looks like a regular address, but with a short code where the street name and number would be." This class tries to provide the "regular address" part in a manner that looks similar to the PlusCode that Google might produce. It gives names of the nearby locations such that a full Open Location Code of "48Q39JW9+G9" would be returned in the form of a local code like "9JW9+G9 Buenos Aires Argentina." This class has a dependency on web services from GeoNames.org. To use the web services, you _must_ get your own API key from GeoNames. Register and login to GeoNames here: https://www.geonames.org/login When you have your API key, insert it into the public static $apikey variable at the top of this class file. The GeoNames API fails sometimes. When this happens the Class returns the original input Open Location Code. The full OLC may still be usable in many applications. A PHP Notice will be issued saying something like this: "ERROR: canceling statement due to statement timeout" The demonstration script for this class will call the GeoNames API repeatedly and in practice that might not be a good idea. You may want to consider downloading and hosting your own version of their database. Documentation References: https://plus.codes/ https://www.geonames.org/about.html https://www.geonames.org/export/ws-overview.html https://www.geonames.org/export/web-services.html#findNearby https://www.geonames.org/export/codes.html |
Files |
File | Role | Description |
---|---|---|
class_PlusCodeLocal.php | Class | PlusCode Localization |
demo_PlusCodeLocal.php | Example | Demonstration Script |
readme_PlusCodeLocal.txt | Doc. | readme text file |
pluscodelocal-2019-01-13.zip 3KB | |
pluscodelocal-2019-01-13.tar.gz | |
Install with Composer |
Needed packages | ||
Class | Download | Why it is needed | Dependency |
---|---|---|---|
PHP PlusCode | .zip .tar.gz | This Class extends PlusCode | Required |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.