You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/Specification/specification.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ This differs from the above method in that each step produces a single character
55
55
This encodes latitude into base five and longitude into base four, and then combines the digits for each position together.
56
56
57
57
The following provides an algorithm to encode the values from least significant digit to most significant digit:
58
-
1. Add 90 to the latiude, multiply the fractional part by 2.5e7 and take the integer part as latitude.
58
+
1. Add 90 to the latitude, multiply the fractional part by 2.5e7 and take the integer part as latitude.
59
59
1. Add 180 to the longitude, multiply the fractional part by 8.192e6 and take the integer part as longitude.
60
60
1. Take the integer part of latitude modulus 5. Multiply that by 4, and add the integer part of the longitude modulus 4.
61
61
1. Prefix the existing code with the symbol with the above value.
@@ -64,8 +64,8 @@ The following provides an algorithm to encode the values from least significant
64
64
65
65
### Code length
66
66
67
-
The minimum valid length of an Open Location Code is two digits.
68
-
The maximum length of an Open Location Code is 15 digits.
67
+
The minimum valid length of a Plus Code is two digits.
68
+
The maximum length of a Plus Code is 15 digits.
69
69
70
70
Below 10 digits, only even numbers are valid lengths.
71
71
@@ -98,7 +98,7 @@ NB: This table assumes one degree is 111321 meters, and that all distances are c
98
98
## Decoding
99
99
100
100
The coordinates obtained when decoding are the south-west corner.
101
-
(The north-east corner and center coordinates can be obtained by adding the precison values.)
101
+
(The north-east corner and center coordinates can be obtained by adding the precision values.)
102
102
103
103
This implies that the north-east coordinates are not included in the area of the code, with the exception of codes whose northern latitude is 90 degrees.
104
104
@@ -137,13 +137,13 @@ Given a global code, _796RWF8Q+WF_, you can eliminate the first **four** digits
137
137
* The center point of the feature is within **0.4** degrees latitude and **0.4** degrees longitude
138
138
* The bounding box of the feature is less than **0.8** degrees high and wide.
139
139
140
-
(These values are chosen because a four digit Open Location Code is 1x1 degrees.)
140
+
(These values are chosen because a four digit Plus Code is 1x1 degrees.)
141
141
142
142
If there is no suitable locality close enough or small enough, you can eliminate the first **two** digits of the code if:
143
143
* The center point of the feature is within **8** degrees latitude and **8** degrees longitude
144
144
* The bounding box of the feature is less than **16** degrees high and wide.
145
145
146
-
(These values are chosen because a two digit Open Location Code is 20x20 degrees.)
146
+
(These values are chosen because a two digit Plus Code is 20x20 degrees.)
147
147
148
148
The values above are slightly smaller than the maximums to allow for different geocoder backends placing localities in slightly different positions.
149
149
Although they could be increased there will be a risk that a shortened code will recover to a different location than the original, and people misdirected.
@@ -156,7 +156,7 @@ If a settlement (such as neighbourhood, town or city) is to be used, you should
156
156
157
157
The following public methods should be provided by any Open Location Code implementation, subject to minor changes caused by language conventions.
158
158
159
-
Note that any method that returns an Open Location Code should return upper case characters.
159
+
Note that any method that returns a Plus Code should return upper case characters.
160
160
161
161
Methods that accept Plus Codes as parameters should be case insensitive.
162
162
@@ -166,41 +166,41 @@ Errors should be returned following the language convention. For example excepti
166
166
167
167
### `isValid`
168
168
169
-
The `isValid` method takes a single parameter, a string, and returns a boolean indicating whether the string is a valid Open Location Code sequence.
169
+
The `isValid` method takes a single parameter, a string, and returns a boolean indicating whether the string is a valid Plus Code.
170
170
171
171
### `isShort`
172
172
173
-
The `isShort` method takes a single parameter, a string, and returns a boolean indicating whether the string is a valid short Open Location Code.
173
+
The `isShort` method takes a single parameter, a string, and returns a boolean indicating whether the string is a valid short Plus Code.
174
174
175
175
See [Short Codes](#short-codes) above.
176
176
177
177
### `isFull`
178
178
179
-
Determines if a code is a valid full (i.e. not shortened) Open Location Code.
179
+
Determines if a code is a valid full (i.e. not shortened) Plus Code.
180
180
181
181
Not all possible combinations of Open Location Code characters decode to valid latitude and longitude values.
182
182
This checks that a code is valid and that the resulting latitude and longitude values are legal.
183
183
Full codes must include the format separator character and it must be after eight characters.
184
184
185
185
### `encode`
186
186
187
-
Encode a location into an Open Location Code.
187
+
Encode a location into a Plus Code.
188
188
This takes a latitude and longitude and an optional length.
189
189
If the length is not specified, a code with 10 digits (and the format separator character) will be returned.
190
190
191
191
### `decode`
192
192
193
-
Decodes an Open Location Code into the location coordinates.
193
+
Decodes a Plus Code into the location coordinates.
194
194
This method takes a string.
195
-
If the string is a valid full Open Location Code, it returns:
195
+
If the string is a valid full Plus Code, it returns:
196
196
- the latitude and longitude of the SW corner of the bounding box;
197
197
- the latitude and longitude of the NE corner of the bounding box;
198
198
- the latitude and longitude of the center of the bounding box;
199
199
- the number of digits in the original code.
200
200
201
201
### `shorten`
202
202
203
-
Passed a valid full Open Location Code and a latitude and longitude this removes as many digits as possible (up to a maximum of six) such that the resulting code is the closest matching code to the passed location.
203
+
Passed a valid full Plus Code and a latitude and longitude this removes as many digits as possible (up to a maximum of six) such that the resulting code is the closest matching code to the passed location.
204
204
A safety factor may be included.
205
205
206
206
If the code cannot be shortened, the original full code should be returned.
@@ -209,4 +209,4 @@ Since the only really useful shortenings are removing the first four or six char
209
209
210
210
### `recoverNearest`
211
211
212
-
This method is passed a valid short Open Location Code and a latitude and longitude, and returns the nearest matching full Open Location Code to the specified location.
212
+
This method is passed a valid short Plus Code and a latitude and longitude, and returns the nearest matching full Plus Code to the specified location.
0 commit comments