File: readme_PlusCode.txt

Recommend this page to a friend!
  Classes of Ray Paseur  >  PHP PlusCode  >  readme_PlusCode.txt  >  Download  
File: readme_PlusCode.txt
Role: Documentation
Content type: text/plain
Description: Readme
Class: PHP PlusCode
Generate PlusCode parameters for Google Maps links
Author: By
Last change: Tidy up
Date: 2 years ago
Size: 1,555 bytes



Class file image Download
Class PlusCode 

This is a lightweight implementation of the Open Location Code (aka 
Google Plus-Code) which gives location information to places that may 
not have street names or addresses.  Like Nepal, for example.

These links give background information about the motivation and the
design of the Open Location Code

Latitude Distance from the Equator
  90 N  ==   90 North Pole
  90 S  ==  -90 South Pole
Longitude Distance from Prime Meridian (Greenwich)
 180 W  == -180
 180 E  ==  180
 180 from Greenwich in either direction is "antimeridian"

The OLC is computed from the south pole (latitude -90) and the 
antimeridian (longitude -180).

Its computation requires positive values so we add 90 and 180 to the 
latitude and longitude, respectively.  The resulting values are 
expressed in base-20 notation using a character set that is designed 
to produce no words.

The Class provides two static methods.

  geocode_to_olc() takes a lat,lng pair and returns a Plus Code
  olc_to_geocode() takes a full Plus Code and returns the lat,lng pair
A Plus Code generated by the Class provides "roof-top accuracy."  It
is possible to get greater accuracy by adding an eleventh character
to the Plus Code, but that is not implemented in this lightweight

For more information send a message to info at phpclasses dot org.