MCPcopy Create free account
hub / github.com/comaps/comaps / GetCenter

Method GetCenter

3party/open-location-code/codearea.cc:29–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27size_t CodeArea::GetCodeLength() const { return code_length_; }
28
29LatLng CodeArea::GetCenter() const {
30 const double latitude_center = std::min(
31 latitude_lo_ + (latitude_hi_ - latitude_lo_) / 2, kLatitudeMaxDegrees);
32 const double longitude_center =
33 std::min(longitude_lo_ + (longitude_hi_ - longitude_lo_) / 2,
34 kLongitudeMaxDegrees);
35 const LatLng center = {latitude_center, longitude_center};
36 return center;
37}
38
39} // namespace openlocationcode

Callers 2

ShortenFunction · 0.45
RecoverNearestFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected