Map longitude: [-180, 180) -> [0, maxValue]
| 174 | |
| 175 | // Map longitude: [-180, 180) -> [0, maxValue] |
| 176 | int LonToInt(double lon, int maxValue) |
| 177 | { |
| 178 | double const x = (LonIn180180(lon) + 180.0) / 360.0 * (maxValue + 1.0) + 0.5; |
| 179 | return (x <= 0 || x >= maxValue + 1) ? 0 : static_cast<int>(x); |
| 180 | } |
| 181 | |
| 182 | void LatLonToString(double lat, double lon, char * s, size_t nBytes) |
| 183 | { |