cpp/openlocationcode.cc
// Adjusts 90 degree latitude to be lower so that a legal OLC code can be
// generated.
Adjusts 90 degree latitude to be lower so that a legal OLC code can be
generated.
Adjusts 90 degree latitude to be lower so that a legal OLC code can be generated .
double adjust_latitude(double latitude_degrees, size_t code_length) {
  latitude_degrees = std::min(90.0, std::max(-90.0, latitude_degrees));
  if (latitude_degrees < internal::kLatitudeMaxDegrees) {
    return latitude_degrees;
  }
  double precision = compute_precision_for_length(code_length);
  return latitude_degrees - precision / 2;
}
double adjust_latitude ( double latitude_degrees , size_t code_length ) { latitude_degrees = std :: min ( 90.0 , std :: max ( -90.0 , latitude_degrees ) ) ; if ( latitude_degrees < internal :: kLatitudeMaxDegrees ) { return latitude_degrees ; } double precision = compute_precision_for_length ( code_length ) ; return latitude_degrees - precision / 2 ; }
Adjusts 90 degree latitude to be lower so that a legal OLC code can be
generated.
Adjusts 90 degree latitude to be lower so that a legal OLC code can be generated .
// Subtract half the code precision to get the latitude into the code // area.