@cond Doxygen_Suppress
| 325 | |
| 326 | //! @cond Doxygen_Suppress |
| 327 | std::string UnitOfMeasure::exportToPROJString() const { |
| 328 | if (type() == Type::LINEAR) { |
| 329 | auto proj_units = pj_list_linear_units(); |
| 330 | for (int i = 0; proj_units[i].id != nullptr; i++) { |
| 331 | if (::fabs(proj_units[i].factor - conversionToSI()) < |
| 332 | 1e-10 * conversionToSI()) { |
| 333 | return proj_units[i].id; |
| 334 | } |
| 335 | } |
| 336 | } else if (type() == Type::ANGULAR) { |
| 337 | auto proj_angular_units = pj_list_angular_units(); |
| 338 | for (int i = 0; proj_angular_units[i].id != nullptr; i++) { |
| 339 | if (::fabs(proj_angular_units[i].factor - conversionToSI()) < |
| 340 | 1e-10 * conversionToSI()) { |
| 341 | return proj_angular_units[i].id; |
| 342 | } |
| 343 | } |
| 344 | } |
| 345 | return std::string(); |
| 346 | } |
| 347 | //! @endcond |
| 348 | |
| 349 | // --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected