computeLatitudePrecision uses a wrong logic:
|
if (codeLength <= CODE_PRECISION_NORMAL) { |
Instead, it should compare
codeLength <= PAIR_CODE_LENGTH
The two constants have different semantics, but the same value (namely 10). So this issue is about code cleanness, not about a wrong run-time behavior.
When fixed, CODE_PRECISION_NORMAL would just determine the default precision for the two-parameter encode. It might then be increased to 11 to match the OLC precision shown by Google Maps for pins, which is about the GPS accuracy in phones.
computeLatitudePrecisionuses a wrong logic:open-location-code/java/src/main/java/com/google/openlocationcode/OpenLocationCode.java
Line 683 in bb54a57
Instead, it should compare
The two constants have different semantics, but the same value (namely 10). So this issue is about code cleanness, not about a wrong run-time behavior.
When fixed,
CODE_PRECISION_NORMALwould just determine the default precision for the two-parameterencode. It might then be increased to 11 to match the OLC precision shown by Google Maps for pins, which is about the GPS accuracy in phones.