crskit 0.6.0__tar.gz → 0.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. {crskit-0.6.0 → crskit-0.7.1}/CMakeLists.txt +6 -1
  2. {crskit-0.6.0 → crskit-0.7.1}/PKG-INFO +1 -1
  3. {crskit-0.6.0 → crskit-0.7.1}/Readme.md +35 -1
  4. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/CompoundCoordinateSystem.cpp +5 -3
  5. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/CoordinateSystem.h +10 -0
  6. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/CoordinateSystemAuthorityFactory.cpp +37 -12
  7. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/CoordinateSystemFactory.cpp +76 -19
  8. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/GeocentricCoordinateSystem.cpp +3 -0
  9. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/GeographicCoordinateSystem.cpp +70 -4
  10. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/GeographicCoordinateSystem.h +6 -0
  11. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/ProjectedCoordinateSystem.cpp +28 -4
  12. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/VerticalCoordinateSystem.cpp +3 -0
  13. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/Wkt2.cpp +36 -7
  14. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/CoordinateTransformationAuthorityFactory.cpp +55 -20
  15. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/CoordinateTransformationFactory.cpp +60 -59
  16. crskit-0.7.1/crskit/CrsAliases.cpp +172 -0
  17. crskit-0.7.1/crskit/CrsAliases.h +84 -0
  18. {crskit-0.6.0 → crskit-0.7.1}/crskit/CrsContext.h +11 -0
  19. {crskit-0.6.0 → crskit-0.7.1}/crskit/EsriProjectionEngine.cpp +84 -83
  20. {crskit-0.6.0 → crskit-0.7.1}/crskit/EsriProjectionEngine.h +3 -2
  21. {crskit-0.6.0 → crskit-0.7.1}/crskit/IAuthorityProvider.h +1 -1
  22. {crskit-0.6.0 → crskit-0.7.1}/crskit/TokenWkt.cpp +13 -1
  23. {crskit-0.6.0 → crskit-0.7.1}/crskit/TokenWkt.h +3 -0
  24. {crskit-0.6.0 → crskit-0.7.1}/ports/crskit/portfile.cmake +3 -2
  25. {crskit-0.6.0 → crskit-0.7.1}/ports/crskit/vcpkg.json +1 -1
  26. {crskit-0.6.0 → crskit-0.7.1}/pyproject.toml +1 -1
  27. crskit-0.7.1/tests/TestCompoundFromWkt.cpp +114 -0
  28. crskit-0.7.1/tests/TestCrsAliases.cpp +483 -0
  29. crskit-0.7.1/tests/TestDatumOfCrs.cpp +23 -0
  30. crskit-0.7.1/tests/TestEsriCompound.cpp +37 -0
  31. crskit-0.7.1/tests/TestEsriTables.cpp +58 -0
  32. crskit-0.7.1/tests/TestEsriTowgs84Snap.cpp +176 -0
  33. crskit-0.7.1/tests/TestGeocentricOperations.cpp +45 -0
  34. crskit-0.7.1/tests/TestHeaderWarnings.cpp +25 -0
  35. crskit-0.7.1/tests/TestNonNumericAuthority.cpp +55 -0
  36. crskit-0.7.1/tests/TestUnknownCrs.cpp +176 -0
  37. crskit-0.7.1/tests/TestWithAxes.cpp +31 -0
  38. {crskit-0.6.0 → crskit-0.7.1}/tests/TestWkt2.cpp +83 -0
  39. {crskit-0.6.0 → crskit-0.7.1}/tools/release.sh +16 -2
  40. {crskit-0.6.0 → crskit-0.7.1}/versions/baseline.json +1 -1
  41. {crskit-0.6.0 → crskit-0.7.1}/versions/c-/crskit.json +10 -0
  42. crskit-0.6.0/tests/TestUnknownCrs.cpp +0 -80
  43. {crskit-0.6.0 → crskit-0.7.1}/.gitattributes +0 -0
  44. {crskit-0.6.0 → crskit-0.7.1}/.github/workflows/ci.yml +0 -0
  45. {crskit-0.6.0 → crskit-0.7.1}/.github/workflows/epsg.yml +0 -0
  46. {crskit-0.6.0 → crskit-0.7.1}/.github/workflows/wheels.yml +0 -0
  47. {crskit-0.6.0 → crskit-0.7.1}/.gitignore +0 -0
  48. {crskit-0.6.0 → crskit-0.7.1}/CMakePresets.json +0 -0
  49. {crskit-0.6.0 → crskit-0.7.1}/LICENSE +0 -0
  50. {crskit-0.6.0 → crskit-0.7.1}/branding/crskit-logo-128.png +0 -0
  51. {crskit-0.6.0 → crskit-0.7.1}/branding/crskit-logo-256.png +0 -0
  52. {crskit-0.6.0 → crskit-0.7.1}/branding/crskit-logo-512.png +0 -0
  53. {crskit-0.6.0 → crskit-0.7.1}/branding/crskit-logo-64.png +0 -0
  54. {crskit-0.6.0 → crskit-0.7.1}/branding/crskit-logo.svg +0 -0
  55. {crskit-0.6.0 → crskit-0.7.1}/branding/crskit.ico +0 -0
  56. {crskit-0.6.0 → crskit-0.7.1}/cmake/crskit-config.cmake.in +0 -0
  57. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/AngularUnit.cpp +0 -0
  58. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/AngularUnit.h +0 -0
  59. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/AxisInfo.h +0 -0
  60. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/AxisOrientationEnum.h +0 -0
  61. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/BaseInfo.h +0 -0
  62. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/CompoundCoordinateSystem.h +0 -0
  63. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/CoordinateSystem.cpp +0 -0
  64. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/CoordinateSystemAuthorityFactory.h +0 -0
  65. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/CoordinateSystemEquivalence.cpp +0 -0
  66. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/CoordinateSystemFactory.h +0 -0
  67. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/Datum.cpp +0 -0
  68. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/Datum.h +0 -0
  69. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/DatumType.h +0 -0
  70. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/Ellipsoid.cpp +0 -0
  71. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/Ellipsoid.h +0 -0
  72. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/GeocentricCoordinateSystem.h +0 -0
  73. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/HorizontalCoordinateSystem.cpp +0 -0
  74. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/HorizontalCoordinateSystem.h +0 -0
  75. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/HorizontalDatum.cpp +0 -0
  76. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/HorizontalDatum.h +0 -0
  77. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/ICompoundCoordinateSystem.h +0 -0
  78. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/ICoordinateSystem.h +0 -0
  79. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/ICoordinateSystemAuthorityFactory.h +0 -0
  80. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/IDatum.h +0 -0
  81. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/IGeocentricCoordinateSystem.h +0 -0
  82. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/IGeographicCoordinateSystem.h +0 -0
  83. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/IHorizontalCoordinateSystem.h +0 -0
  84. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/IHorizontalDatum.h +0 -0
  85. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/IInfo.h +0 -0
  86. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/ILocalCoordinateSystem.h +0 -0
  87. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/ILocalDatum.h +0 -0
  88. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/IProjectedCoordinateSystem.h +0 -0
  89. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/IProjection.h +0 -0
  90. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/IVerticalCoordinateSystem.h +0 -0
  91. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/IVerticalDatum.h +0 -0
  92. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/LinearUnit.cpp +0 -0
  93. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/LinearUnit.h +0 -0
  94. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/LocalCoordinateSystem.cpp +0 -0
  95. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/LocalCoordinateSystem.h +0 -0
  96. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/LocalDatum.cpp +0 -0
  97. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/LocalDatum.h +0 -0
  98. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/PrimeMeridian.cpp +0 -0
  99. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/PrimeMeridian.h +0 -0
  100. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/ProjectedCoordinateSystem.h +0 -0
  101. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/Projection.cpp +0 -0
  102. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/Projection.h +0 -0
  103. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/Unit.h +0 -0
  104. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/VerticalCoordinateSystem.h +0 -0
  105. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/VerticalDatum.cpp +0 -0
  106. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/VerticalDatum.h +0 -0
  107. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/Wgs84ConversionInfo.h +0 -0
  108. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateSystems/Wkt2.h +0 -0
  109. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformationOptions.h +0 -0
  110. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Affine.cpp +0 -0
  111. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Afine.h +0 -0
  112. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/AlbersConicEqualArea.cpp +0 -0
  113. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/AlbersConicEqualArea.h +0 -0
  114. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/AmericanPolyconic.cpp +0 -0
  115. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/AmericanPolyconic.h +0 -0
  116. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Authalic.h +0 -0
  117. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/AzimuthalProjections.cpp +0 -0
  118. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/AzimuthalProjections.h +0 -0
  119. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/CassiniSoldner.cpp +0 -0
  120. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/CassiniSoldner.h +0 -0
  121. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/CoordinateFrameRotation.cpp +0 -0
  122. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/CoordinateFrameRotation.h +0 -0
  123. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/CylindricalProjections.cpp +0 -0
  124. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/CylindricalProjections.h +0 -0
  125. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GeocentricToTopocentric.cpp +0 -0
  126. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GeocentricToTopocentric.h +0 -0
  127. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GeocentricTranslations.cpp +0 -0
  128. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GeocentricTranslations.h +0 -0
  129. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Geodesic.h +0 -0
  130. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Geographic2D2Geocentric.cpp +0 -0
  131. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Geographic2D2Geocentric.h +0 -0
  132. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Geographic2D2Geographic3D.cpp +0 -0
  133. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Geographic2D2Geographic3D.h +0 -0
  134. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Geographic3DToGravityRelatedHeightEGM.cpp +0 -0
  135. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Geographic3DToGravityRelatedHeightEGM.h +0 -0
  136. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Geographic3DToGravityRelatedHeightEGM2008.cpp +0 -0
  137. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Geographic3DToGravityRelatedHeightEGM2008.h +0 -0
  138. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridAusGeoid.cpp +0 -0
  139. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridAusGeoid.h +0 -0
  140. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridEGM2008.cpp +0 -0
  141. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridEGM2008.h +0 -0
  142. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridEGM2008Rednap.cpp +0 -0
  143. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridEGM2008Rednap.h +0 -0
  144. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridGtg.cpp +0 -0
  145. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridGtg.h +0 -0
  146. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridGtx.cpp +0 -0
  147. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridGtx.h +0 -0
  148. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/Inflate.cpp +0 -0
  149. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/GridFiles/Inflate.h +0 -0
  150. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/HotineObliqueMercator.cpp +0 -0
  151. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/HotineObliqueMercator.h +0 -0
  152. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Krovak.cpp +0 -0
  153. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Krovak.h +0 -0
  154. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/LambertAzimuthalEqualArea.cpp +0 -0
  155. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/LambertAzimuthalEqualArea.h +0 -0
  156. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/LambertConformalConic1SP.cpp +0 -0
  157. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/LambertConformalConic1SP.h +0 -0
  158. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/LambertConformalConic2SP.cpp +0 -0
  159. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/LambertConformalConic2SP.h +0 -0
  160. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/LambertConicConformalVariants.cpp +0 -0
  161. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/LambertConicConformalVariants.h +0 -0
  162. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/LongitudeRotation.cpp +0 -0
  163. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/LongitudeRotation.h +0 -0
  164. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/MapProjectionBase.cpp +0 -0
  165. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/MapProjectionBase.h +0 -0
  166. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Mercator1Sp.cpp +0 -0
  167. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Mercator1Sp.h +0 -0
  168. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Mercator2Sp.cpp +0 -0
  169. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Mercator2Sp.h +0 -0
  170. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/MolodenskyBadekas.cpp +0 -0
  171. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/MolodenskyBadekas.h +0 -0
  172. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/NadCon.cpp +0 -0
  173. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/NadCon.h +0 -0
  174. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Ntv2.cpp +0 -0
  175. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/Ntv2.h +0 -0
  176. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/ObliqueMercator.cpp +0 -0
  177. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/ObliqueMercator.h +0 -0
  178. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/ObliqueStereographic.cpp +0 -0
  179. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/ObliqueStereographic.h +0 -0
  180. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/OtherProjections.cpp +0 -0
  181. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/OtherProjections.h +0 -0
  182. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/P6.cpp +0 -0
  183. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/P6.h +0 -0
  184. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/PolarStereographic.cpp +0 -0
  185. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/PolarStereographic.h +0 -0
  186. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/PopularVisualisationPseudoMercator.cpp +0 -0
  187. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/PopularVisualisationPseudoMercator.h +0 -0
  188. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/PositionVectorTransformation.cpp +0 -0
  189. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/PositionVectorTransformation.h +0 -0
  190. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/TransverseMercator.cpp +0 -0
  191. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/TransverseMercator.h +0 -0
  192. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/TransverseMercatorSouthOrientated.cpp +0 -0
  193. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/TransverseMercatorSouthOrientated.h +0 -0
  194. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/VerticalOffset.cpp +0 -0
  195. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Algorithms/VerticalOffset.h +0 -0
  196. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/ConcatenatedTransform.cpp +0 -0
  197. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/ConcatenatedTransform.h +0 -0
  198. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/CoordinateOperation.h +0 -0
  199. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/CoordinateTransformation.cpp +0 -0
  200. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/CoordinateTransformation.h +0 -0
  201. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/CoordinateTransformationAuthorityFactory.h +0 -0
  202. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/CoordinateTransformationFactory.h +0 -0
  203. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/DomainFlags.h +0 -0
  204. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/ICoordinateTransformation.h +0 -0
  205. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/ICoordinateTransformationAuthorityFactory.h +0 -0
  206. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/ICoordinateTransformationFactory.h +0 -0
  207. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/IMathTransform.h +0 -0
  208. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/IMathTransformFactory.h +0 -0
  209. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/MathTransformBase.cpp +0 -0
  210. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/MathTransformBase.h +0 -0
  211. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/MathTransformFactory.cpp +0 -0
  212. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/MathTransformFactory.h +0 -0
  213. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/MathTransformRegistry.cpp +0 -0
  214. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/MathTransformRegistry.h +0 -0
  215. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Passthrough.cpp +0 -0
  216. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/Passthrough.h +0 -0
  217. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/TransformType.h +0 -0
  218. {crskit-0.6.0 → crskit-0.7.1}/crskit/CoordinateTransformations/UnitsOfMeasure.h +0 -0
  219. {crskit-0.6.0 → crskit-0.7.1}/crskit/CrsKit.h +0 -0
  220. {crskit-0.6.0 → crskit-0.7.1}/crskit/CrsKitExport.h +0 -0
  221. {crskit-0.6.0 → crskit-0.7.1}/crskit/ExtensionManager.cpp +0 -0
  222. {crskit-0.6.0 → crskit-0.7.1}/crskit/ExtensionManager.h +0 -0
  223. {crskit-0.6.0 → crskit-0.7.1}/crskit/Factory.h +0 -0
  224. {crskit-0.6.0 → crskit-0.7.1}/crskit/GridFileNotFoundException.h +0 -0
  225. {crskit-0.6.0 → crskit-0.7.1}/crskit/IUtilities.h +0 -0
  226. {crskit-0.6.0 → crskit-0.7.1}/crskit/Mathematics/Angles.h +0 -0
  227. {crskit-0.6.0 → crskit-0.7.1}/crskit/Mathematics/Concepts.h +0 -0
  228. {crskit-0.6.0 → crskit-0.7.1}/crskit/Mathematics/GridCell.h +0 -0
  229. {crskit-0.6.0 → crskit-0.7.1}/crskit/Mathematics/GridInterpolation.h +0 -0
  230. {crskit-0.6.0 → crskit-0.7.1}/crskit/Mathematics/Interpolation.h +0 -0
  231. {crskit-0.6.0 → crskit-0.7.1}/crskit/Mathematics/Matrix.h +0 -0
  232. {crskit-0.6.0 → crskit-0.7.1}/crskit/Mathematics/Point.h +0 -0
  233. {crskit-0.6.0 → crskit-0.7.1}/crskit/Mathematics/Window2D.h +0 -0
  234. {crskit-0.6.0 → crskit-0.7.1}/crskit/OpenGisAttributes.h +0 -0
  235. {crskit-0.6.0 → crskit-0.7.1}/crskit/OpenGisException.h +0 -0
  236. {crskit-0.6.0 → crskit-0.7.1}/crskit/Parameter.h +0 -0
  237. {crskit-0.6.0 → crskit-0.7.1}/crskit/Positioning/Envelope.h +0 -0
  238. {crskit-0.6.0 → crskit-0.7.1}/crskit/SqliteProvider.h +0 -0
  239. {crskit-0.6.0 → crskit-0.7.1}/crskit/StringUtil.h +0 -0
  240. {crskit-0.6.0 → crskit-0.7.1}/crskit/Utilities.cpp +0 -0
  241. {crskit-0.6.0 → crskit-0.7.1}/crskit/Utilities.h +0 -0
  242. {crskit-0.6.0 → crskit-0.7.1}/crskit/WktDeserializer.cpp +0 -0
  243. {crskit-0.6.0 → crskit-0.7.1}/crskit/WktDeserializer.h +0 -0
  244. {crskit-0.6.0 → crskit-0.7.1}/crskit/app.ico +0 -0
  245. {crskit-0.6.0 → crskit-0.7.1}/crskit/pch.cpp +0 -0
  246. {crskit-0.6.0 → crskit-0.7.1}/crskit/pch.h +0 -0
  247. {crskit-0.6.0 → crskit-0.7.1}/data/grid-sources.json +0 -0
  248. {crskit-0.6.0 → crskit-0.7.1}/external/sqlite/sqlite3.c +0 -0
  249. {crskit-0.6.0 → crskit-0.7.1}/external/sqlite/sqlite3.h +0 -0
  250. {crskit-0.6.0 → crskit-0.7.1}/python/CMakeLists.txt +0 -0
  251. {crskit-0.6.0 → crskit-0.7.1}/python/README.md +0 -0
  252. {crskit-0.6.0 → crskit-0.7.1}/python/TUTORIAL.de.md +0 -0
  253. {crskit-0.6.0 → crskit-0.7.1}/python/TUTORIAL.es.md +0 -0
  254. {crskit-0.6.0 → crskit-0.7.1}/python/TUTORIAL.fr.md +0 -0
  255. {crskit-0.6.0 → crskit-0.7.1}/python/TUTORIAL.it.md +0 -0
  256. {crskit-0.6.0 → crskit-0.7.1}/python/TUTORIAL.md +0 -0
  257. {crskit-0.6.0 → crskit-0.7.1}/python/crskit/__init__.py +0 -0
  258. {crskit-0.6.0 → crskit-0.7.1}/python/crskit/_crskit.pyi +0 -0
  259. {crskit-0.6.0 → crskit-0.7.1}/python/crskit/py.typed +0 -0
  260. {crskit-0.6.0 → crskit-0.7.1}/python/examples/01_quickstart.py +0 -0
  261. {crskit-0.6.0 → crskit-0.7.1}/python/examples/02_wkt.py +0 -0
  262. {crskit-0.6.0 → crskit-0.7.1}/python/examples/03_point_cloud.py +0 -0
  263. {crskit-0.6.0 → crskit-0.7.1}/python/examples/04_choosing_the_operation.py +0 -0
  264. {crskit-0.6.0 → crskit-0.7.1}/python/examples/05_orthometric_heights.py +0 -0
  265. {crskit-0.6.0 → crskit-0.7.1}/python/examples/06_global_geoid.py +0 -0
  266. {crskit-0.6.0 → crskit-0.7.1}/python/examples/README.md +0 -0
  267. {crskit-0.6.0 → crskit-0.7.1}/python/examples/_setup.py +0 -0
  268. {crskit-0.6.0 → crskit-0.7.1}/python/src/module.cpp +0 -0
  269. {crskit-0.6.0 → crskit-0.7.1}/python/tests/test_crskit.py +0 -0
  270. {crskit-0.6.0 → crskit-0.7.1}/python/tests/test_examples.py +0 -0
  271. {crskit-0.6.0 → crskit-0.7.1}/python-epsg/README.md +0 -0
  272. {crskit-0.6.0 → crskit-0.7.1}/python-epsg/crskit_epsg/EPSG-TERMS-OF-USE.md +0 -0
  273. {crskit-0.6.0 → crskit-0.7.1}/python-epsg/crskit_epsg/__init__.py +0 -0
  274. {crskit-0.6.0 → crskit-0.7.1}/python-epsg/fetch.py +0 -0
  275. {crskit-0.6.0 → crskit-0.7.1}/python-epsg/pyproject.toml +0 -0
  276. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5101Part2.cpp +0 -0
  277. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5101Part3.cpp +0 -0
  278. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5101Part4.cpp +0 -0
  279. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5102Part1.cpp +0 -0
  280. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5102Part2.cpp +0 -0
  281. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5103Part1.cpp +0 -0
  282. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5103Part2.cpp +0 -0
  283. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5103Part3.cpp +0 -0
  284. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5104Part1.cpp +0 -0
  285. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5105Part1.cpp +0 -0
  286. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5105Part2.cpp +0 -0
  287. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5106Part1.cpp +0 -0
  288. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5107Part1.cpp +0 -0
  289. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5108Part1.cpp +0 -0
  290. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5109Part1.cpp +0 -0
  291. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5110Part1.cpp +0 -0
  292. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5111Part1.cpp +0 -0
  293. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5111Part2.cpp +0 -0
  294. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5112Part1.cpp +0 -0
  295. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5113Part1.cpp +0 -0
  296. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5201Part1.cpp +0 -0
  297. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5203Part1.cpp +0 -0
  298. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5204Part1.cpp +0 -0
  299. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5205Part1.cpp +0 -0
  300. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5205Part2.cpp +0 -0
  301. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5207Part1.cpp +0 -0
  302. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5207Part2.cpp +0 -0
  303. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5208Part1.cpp +0 -0
  304. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5209Part1.cpp +0 -0
  305. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part1.cpp +0 -0
  306. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part10.cpp +0 -0
  307. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part11.cpp +0 -0
  308. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part12.cpp +0 -0
  309. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part2.cpp +0 -0
  310. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part3.cpp +0 -0
  311. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part4.cpp +0 -0
  312. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part5.cpp +0 -0
  313. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part6.cpp +0 -0
  314. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part7.cpp +0 -0
  315. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part8.cpp +0 -0
  316. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5210Part9.cpp +0 -0
  317. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5212Part1.cpp +0 -0
  318. {crskit-0.6.0 → crskit-0.7.1}/tests/Gigs/Test5213Part1.cpp +0 -0
  319. {crskit-0.6.0 → crskit-0.7.1}/tests/GigsFactory.h +0 -0
  320. {crskit-0.6.0 → crskit-0.7.1}/tests/Test5101Part1.cpp +0 -0
  321. {crskit-0.6.0 → crskit-0.7.1}/tests/TestAmericanPolyconic.cpp +0 -0
  322. {crskit-0.6.0 → crskit-0.7.1}/tests/TestAntimeridian.cpp +0 -0
  323. {crskit-0.6.0 → crskit-0.7.1}/tests/TestAzimuthalProjections.cpp +0 -0
  324. {crskit-0.6.0 → crskit-0.7.1}/tests/TestBase.h +0 -0
  325. {crskit-0.6.0 → crskit-0.7.1}/tests/TestCassiniSoldner.cpp +0 -0
  326. {crskit-0.6.0 → crskit-0.7.1}/tests/TestCatalogueSweep.cpp +0 -0
  327. {crskit-0.6.0 → crskit-0.7.1}/tests/TestContextEnvironment.cpp +0 -0
  328. {crskit-0.6.0 → crskit-0.7.1}/tests/TestCylindricalProjections.cpp +0 -0
  329. {crskit-0.6.0 → crskit-0.7.1}/tests/TestDatabaseErrors.cpp +0 -0
  330. {crskit-0.6.0 → crskit-0.7.1}/tests/TestEnvironment.cpp +0 -0
  331. {crskit-0.6.0 → crskit-0.7.1}/tests/TestEquivalence.cpp +0 -0
  332. {crskit-0.6.0 → crskit-0.7.1}/tests/TestExceptions.cpp +0 -0
  333. {crskit-0.6.0 → crskit-0.7.1}/tests/TestGeocentricWkt.cpp +0 -0
  334. {crskit-0.6.0 → crskit-0.7.1}/tests/TestGridCell.cpp +0 -0
  335. {crskit-0.6.0 → crskit-0.7.1}/tests/TestGridFile.cpp +0 -0
  336. {crskit-0.6.0 → crskit-0.7.1}/tests/TestKrovak.cpp +0 -0
  337. {crskit-0.6.0 → crskit-0.7.1}/tests/TestLambertAzimuthalEqualArea.cpp +0 -0
  338. {crskit-0.6.0 → crskit-0.7.1}/tests/TestLambertConicConformalVariants.cpp +0 -0
  339. {crskit-0.6.0 → crskit-0.7.1}/tests/TestObliqueMercator.cpp +0 -0
  340. {crskit-0.6.0 → crskit-0.7.1}/tests/TestOperationSelection.cpp +0 -0
  341. {crskit-0.6.0 → crskit-0.7.1}/tests/TestOtherProjections.cpp +0 -0
  342. {crskit-0.6.0 → crskit-0.7.1}/tests/TestPolarStereographic.cpp +0 -0
  343. {crskit-0.6.0 → crskit-0.7.1}/tests/TestProjectionEdges.cpp +0 -0
  344. {crskit-0.6.0 → crskit-0.7.1}/tests/TestProjectionParameters.cpp +0 -0
  345. {crskit-0.6.0 → crskit-0.7.1}/tests/TestSexagesimalDms.cpp +0 -0
  346. {crskit-0.6.0 → crskit-0.7.1}/tests/TestTowgs84.cpp +0 -0
  347. {crskit-0.6.0 → crskit-0.7.1}/tests/TestTransformPoints.cpp +0 -0
  348. {crskit-0.6.0 → crskit-0.7.1}/tests/TestTransformationAuthorityCode.cpp +0 -0
  349. {crskit-0.6.0 → crskit-0.7.1}/tests/TestUtilitiesContract.cpp +0 -0
  350. {crskit-0.6.0 → crskit-0.7.1}/tests/TestWestSouthAxes.cpp +0 -0
  351. {crskit-0.6.0 → crskit-0.7.1}/tests/TestWktMalformed.cpp +0 -0
  352. {crskit-0.6.0 → crskit-0.7.1}/tests/TestWktQuoted.cpp +0 -0
  353. {crskit-0.6.0 → crskit-0.7.1}/tests/TestWktUnclosed.cpp +0 -0
  354. {crskit-0.6.0 → crskit-0.7.1}/tests/vcpkg.json +0 -0
  355. {crskit-0.6.0 → crskit-0.7.1}/tools/epsg-sqlite/README.md +0 -0
  356. {crskit-0.6.0 → crskit-0.7.1}/tools/epsg-sqlite/epsg_sql_to_sqlite.py +0 -0
  357. {crskit-0.6.0 → crskit-0.7.1}/vcpkg.json +0 -0
@@ -125,7 +125,12 @@ if(DIGI21_BUILD_TESTS)
125
125
  "${CMAKE_CURRENT_SOURCE_DIR}/external/sqlite")
126
126
 
127
127
  target_compile_definitions(crskit_tests PRIVATE
128
- _CONSOLE _CRT_SECURE_NO_WARNINGS GTEST_LINKED_AS_SHARED_LIBRARY=1 UNICODE _UNICODE)
128
+ _CONSOLE _CRT_SECURE_NO_WARNINGS UNICODE _UNICODE)
129
+ # The gtest headers import their symbols from a DLL only when gtest is one; the fetched gtest is static.
130
+ get_target_property(GTEST_LIBRARY_TYPE GTest::gtest TYPE)
131
+ if(GTEST_LIBRARY_TYPE STREQUAL "SHARED_LIBRARY")
132
+ target_compile_definitions(crskit_tests PRIVATE GTEST_LINKED_AS_SHARED_LIBRARY=1)
133
+ endif()
129
134
 
130
135
  # Own main() in TestEnvironment.cpp -> do not link gtest_main.
131
136
  target_link_libraries(crskit_tests PRIVATE crskit GTest::gtest)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crskit
3
- Version: 0.6.0
3
+ Version: 0.7.1
4
4
  Summary: Coordinate reference systems and coordinate transformations (OGC Coordinate Transformation Services, EPSG, WKT 1 and WKT 2)
5
5
  Keywords: EPSG,CRS,WKT,coordinate,transformation,projection,geodesy,GIS
6
6
  Author-Email: José Ángel Martínez Torres <joseangelmt@outlook.com>
@@ -32,10 +32,16 @@ applies transformations between systems, backed by the full EPSG catalogue.
32
32
 
33
33
  ## Using CrsKit (vcpkg)
34
34
 
35
- CrsKit is distributed as a vcpkg registry. Point your project at it in `vcpkg-configuration.json`:
35
+ CrsKit is distributed as a vcpkg registry. Point your project at it in `vcpkg-configuration.json`. vcpkg
36
+ requires a baseline for the default registry when other registries are listed, so the file sets both:
36
37
 
37
38
  ```json
38
39
  {
40
+ "default-registry": {
41
+ "kind": "git",
42
+ "repository": "https://github.com/microsoft/vcpkg",
43
+ "baseline": "<commit of microsoft/vcpkg>"
44
+ },
39
45
  "registries": [
40
46
  {
41
47
  "kind": "git",
@@ -54,6 +60,34 @@ find_package(crskit CONFIG REQUIRED)
54
60
  target_link_libraries(your_target PRIVATE crskit::crskit)
55
61
  ```
56
62
 
63
+ ### CRS and operation aliases
64
+
65
+ Data stored with CRS codes or WKT that are not in the EPSG catalogue (an application's own vertical
66
+ datum, a superseded code) can be resolved as the official CRS through `CrsContext::aliases`
67
+ (`crskit/CrsAliases.h`). The application fills three tables:
68
+
69
+ ```cpp
70
+ auto& aliases = CrsKit::GetDefaultContext()->aliases;
71
+ aliases.AddCrs(900001, 5773); // EPSG:900001 -> EPSG:5773 (EGM96 height)
72
+ aliases.AddCrs("MyApp", 17, 5773); // MyApp:17 -> EPSG:5773
73
+ aliases.AddCrsName("My local height", 5773); // a CRS with this name and no AUTHORITY/ID -> EPSG:5773
74
+ aliases.AddOperation(900100, 10084); // operation 900100 -> EPSG operation 10084
75
+ ```
76
+
77
+ - Each alias is applied **before** the catalogue is consulted, under both `WktParsePolicy` values: a CRS
78
+ that matches is the official CRS built entirely from the catalogue (name, datum, unit, code), and
79
+ `GetWkt()` emits that CRS. The WKT1 `AXIS` of a geographic or projected CRS, when present, is kept.
80
+ - It applies to `CoordinateSystemAuthorityFactory` (every CRS created by code), to the WKT1 and WKT2
81
+ readers (by `AUTHORITY`/`ID`, and by name only when the WKT node has no `AUTHORITY`/`ID`: a WKT that
82
+ carries a code without an alias keeps that code), to each component of a compound CRS (a compound
83
+ whose component is replaced takes its name from the components and loses its own code), to ESRI WKT,
84
+ and to `CoordinateTransformationAuthorityFactory` (operation codes, the code returned by
85
+ `selectOperation`, and the CRS codes it looks operations up by).
86
+ - Names are compared without ASCII case, with `_` read as a space and runs of spaces collapsed and
87
+ trimmed. Bytes outside ASCII are compared as they are: UTF-8 accents must match exactly.
88
+ - Chains (`A -> B`, `B -> C`) are rejected with `std::invalid_argument`. Compound CRS codes cannot be
89
+ aliased; their components can.
90
+
57
91
  ## Using CrsKit from Python
58
92
 
59
93
  CrsKit has a Python binding (pybind11), published as a wheel:
@@ -28,16 +28,18 @@ namespace CrsKit::CoordinateSystems
28
28
 
29
29
  auto CompoundCoordinateSystem::FromWkt(Wkt::TokenWkt const& token) -> std::shared_ptr<CompoundCoordinateSystem>
30
30
  {
31
- // Preserve the compound CRS authority if the WKT declares one.
31
+ // Preserve the compound CRS authority if the WKT declares one, unless an alias replaced a component:
32
+ // the code then no longer describes the compound.
32
33
  auto const [authority, authorityCode] = Wkt::ReadAuthority(token);
34
+ auto const componentAliased = FindCrsAlias(token.GetChild(1)).has_value() || FindCrsAlias(token.GetChild(2)).has_value();
33
35
 
34
36
  auto const head = CoordinateSystemFactory::CreateFrom(token.GetChild(1));
35
37
  auto const tail = CoordinateSystemFactory::CreateFrom(token.GetChild(2));
36
38
 
37
39
  return make_shared<CompoundCoordinateSystem>(
38
40
  head->GetName() + " + " + tail->GetName(),
39
- authority,
40
- authorityCode,
41
+ componentAliased ? std::string{} : authority,
42
+ componentAliased ? 0 : authorityCode,
41
43
  "",
42
44
  "",
43
45
  head,
@@ -1,6 +1,7 @@
1
1
  #pragma once
2
2
 
3
3
  #include <memory>
4
+ #include <optional>
4
5
  #include <string>
5
6
  #include <utility>
6
7
  #include <vector>
@@ -13,6 +14,11 @@
13
14
  #include "ICoordinateSystem.h"
14
15
  #include "Unit.h"
15
16
 
17
+ namespace CrsKit::Wkt
18
+ {
19
+ class TokenWkt;
20
+ }
21
+
16
22
  namespace CrsKit::CoordinateSystems
17
23
  {
18
24
  class _modeCrsKit CoordinateSystem : public BaseInfo, virtual public ICoordinateSystem, public std::enable_shared_from_this<CoordinateSystem>
@@ -60,6 +66,10 @@ namespace CrsKit::CoordinateSystems
60
66
  // the catalogue instead of building it from the pieces. Shared by the FromWkt readers.
61
67
  [[nodiscard]] auto CatalogWins() -> bool;
62
68
 
69
+ // The EPSG code a WKT1/WKT2 CRS node resolves to through CrsContext::aliases: by its ID/AUTHORITY
70
+ // first, by its name second. nullopt when no alias matches.
71
+ [[nodiscard]] auto FindCrsAlias(Wkt::TokenWkt const& node) -> std::optional<int>;
72
+
63
73
  // Graded structural similarity of two CRS, 0..100. Walks the same mathematical components as
64
74
  // AreEquivalent (datum, prime meridian, projection + parameters, units), but scores how many of them
65
75
  // match instead of returning a yes/no; 100 means fully equivalent, lower values a partial match.
@@ -26,6 +26,15 @@ using namespace std;
26
26
 
27
27
  namespace CrsKit::Epsg
28
28
  {
29
+ namespace
30
+ {
31
+ // The EPSG code a CRS code resolves to through CrsContext::aliases (itself when it has no alias).
32
+ auto ResolveCrsAlias(int code) -> int
33
+ {
34
+ return GetDefaultContext()->aliases.ResolveCrs(code);
35
+ }
36
+ }
37
+
29
38
  CoordinateSystemAuthorityFactory::CoordinateSystemAuthorityFactory(std::shared_ptr<Epsg::IAuthorityProvider> const& authorityProvider)
30
39
  : _provider{ authorityProvider }
31
40
  {
@@ -38,6 +47,7 @@ namespace CrsKit::Epsg
38
47
 
39
48
  auto CoordinateSystemAuthorityFactory::CreateCoordinateSystem(int code) const->std::shared_ptr<CoordinateSystems::CoordinateSystem>
40
49
  {
50
+ code = ResolveCrsAlias(code);
41
51
  auto const coordinateSystemType = _provider->GetCoordinateSystemType(code);
42
52
  if (0 == compareNoCase(coordinateSystemType.c_str(), "projected"))
43
53
  return CreateProjectedCoordinateSystem(code);
@@ -60,6 +70,7 @@ namespace CrsKit::Epsg
60
70
 
61
71
  auto CoordinateSystemAuthorityFactory::CreateProjectedCoordinateSystem(int code) const -> std::shared_ptr<ProjectedCoordinateSystem>
62
72
  {
73
+ code = ResolveCrsAlias(code);
63
74
  // ProjectedCoordinateSystem holds two axes: a projected 3D CRS (EPSG 9895, with ellipsoidal height) is rejected.
64
75
  auto const axis = CreateAxisInformation(code);
65
76
  if (axis.size() > 2)
@@ -70,6 +81,7 @@ namespace CrsKit::Epsg
70
81
 
71
82
  auto CoordinateSystemAuthorityFactory::CreateProjectedCoordinateSystem(int code, std::vector<AxisInfo> const& axis) const -> std::shared_ptr<ProjectedCoordinateSystem>
72
83
  {
84
+ code = ResolveCrsAlias(code);
73
85
  auto const coordinateSystemName = _provider->GetCoordinateReferenceSystemName(code, IsEsri(GetDefaultContext()->wktVersion));
74
86
  if (coordinateSystemName.empty())
75
87
  throw AuthorityCodeNotFoundException(std::format("Could not locate the coordinate system with code: {}", code) );
@@ -105,6 +117,7 @@ namespace CrsKit::Epsg
105
117
 
106
118
  auto CoordinateSystemAuthorityFactory::CreateProjectedCoordinateSystem(int projectionCode, int geographicCrsCode) const -> std::shared_ptr<ProjectedCoordinateSystem>
107
119
  {
120
+ geographicCrsCode = ResolveCrsAlias(geographicCrsCode);
108
121
  auto const maximum = _provider->GetProjectedCrsCountFromProjConvCodeAndBaseCrsCode(projectionCode, geographicCrsCode);
109
122
  if (0 == maximum)
110
123
  throw runtime_error("No projected coordinate system with the specified parameters has been located." );
@@ -155,11 +168,13 @@ namespace CrsKit::Epsg
155
168
 
156
169
  auto CoordinateSystemAuthorityFactory::CreateGeographicCoordinateSystem(int code) const -> std::shared_ptr<GeographicCoordinateSystem>
157
170
  {
171
+ code = ResolveCrsAlias(code);
158
172
  return CreateGeographicCoordinateSystem(code, CreateAxisInformation(code));
159
173
  }
160
174
 
161
175
  auto CoordinateSystemAuthorityFactory::CreateGeographicCoordinateSystem(int code, std::vector<AxisInfo> const& axis) const -> std::shared_ptr<GeographicCoordinateSystem>
162
176
  {
177
+ code = ResolveCrsAlias(code);
163
178
  auto const coordinateSystemName = _provider->GetCoordinateReferenceSystemName(code, IsEsri(GetDefaultContext()->wktVersion));
164
179
  if (coordinateSystemName.empty())
165
180
  throw AuthorityCodeNotFoundException(std::format("Unable to locate coordinate system with authority code: {}", code) );
@@ -411,6 +426,7 @@ namespace CrsKit::Epsg
411
426
 
412
427
  auto CoordinateSystemAuthorityFactory::CreateVerticalCoordinateSystem(int code) const -> std::shared_ptr<VerticalCoordinateSystem>
413
428
  {
429
+ code = ResolveCrsAlias(code);
414
430
  auto const coordinateSystemName = _provider->GetCoordinateReferenceSystemName(code, IsEsri(GetDefaultContext()->wktVersion));
415
431
  if (coordinateSystemName.empty())
416
432
  throw AuthorityCodeNotFoundException(std::format("Unable to locate coordinate system with authority code: {}", code));
@@ -423,17 +439,7 @@ namespace CrsKit::Epsg
423
439
 
424
440
  auto const axis = CreateAxisInformation(code);
425
441
  auto const units = CreateUnitsInformation(code);
426
- // A derived vertical CRS has no DATUM_CODE and inherits the datum of its BASE_CRS_CODE, which can be
427
- // derived too: 6358 (NAVD88 depth (ftUS)) -> 6360 (NAVD88 height (ftUS)) -> 5703 (NAVD88 height).
428
- auto datumCode = _provider->GetDatumCodeForCrs(code);
429
- for (auto baseCrsCode = code, depth = 0; 0 == datumCode && depth < 8; ++depth)
430
- {
431
- baseCrsCode = _provider->GetGeographicCrsCodeForProjectedCrs(baseCrsCode);
432
- if (0 == baseCrsCode)
433
- break;
434
- datumCode = _provider->GetDatumCodeForCrs(baseCrsCode);
435
- }
436
- auto const verticalDatum = CreateVerticalDatum(datumCode);
442
+ auto const verticalDatum = CreateVerticalDatum(GetCodeOfDatumAssociatedWithCrs(code));
437
443
 
438
444
  return make_shared<VerticalCoordinateSystem>(
439
445
  coordinateSystemName,
@@ -453,6 +459,7 @@ namespace CrsKit::Epsg
453
459
 
454
460
  auto CoordinateSystemAuthorityFactory::CreateGeocentricCoordinateSystem(int code) const -> std::shared_ptr<GeocentricCoordinateSystem>
455
461
  {
462
+ code = ResolveCrsAlias(code);
456
463
  auto const coordinateSystemName = _provider->GetCoordinateReferenceSystemName(code, IsEsri(GetDefaultContext()->wktVersion));
457
464
  if (coordinateSystemName.empty())
458
465
  throw AuthorityCodeNotFoundException(std::format("Unable to locate coordinate system with authority code: {}", code));
@@ -490,6 +497,7 @@ namespace CrsKit::Epsg
490
497
 
491
498
  auto CoordinateSystemAuthorityFactory::CreateHorizontalCoordinateSystem(int code) const -> std::shared_ptr<HorizontalCoordinateSystem>
492
499
  {
500
+ code = ResolveCrsAlias(code);
493
501
  // We check whether it is projected or geographic
494
502
  auto const coordinateSystemType = _provider->GetCoordinateSystemType(code);
495
503
  if (0 == compareNoCase(coordinateSystemType.c_str(), "projected"))
@@ -512,16 +520,19 @@ namespace CrsKit::Epsg
512
520
 
513
521
  auto CoordinateSystemAuthorityFactory::GetKindOfCoordinateSystem(int code) const->std::string
514
522
  {
523
+ code = ResolveCrsAlias(code);
515
524
  return _provider->GetCoordinateSystemType(code);
516
525
  }
517
526
 
518
527
  auto CoordinateSystemAuthorityFactory::GetDescriptionAreaApplicationCrs(int code) const -> std::string
519
528
  {
529
+ code = ResolveCrsAlias(code);
520
530
  return _provider->GetApplicationAreaDescription(code);
521
531
  }
522
532
 
523
533
  auto CoordinateSystemAuthorityFactory::GetCodeOfCoordinateSystemAssociatedWithCrs(int code) const -> int
524
534
  {
535
+ code = ResolveCrsAlias(code);
525
536
  return _provider->GetCoordinateSystemCodeForCrs(code);
526
537
  }
527
538
 
@@ -547,7 +558,19 @@ namespace CrsKit::Epsg
547
558
 
548
559
  auto CoordinateSystemAuthorityFactory::GetCodeOfDatumAssociatedWithCrs(int code) const -> int
549
560
  {
550
- return _provider->GetDatumCodeForCrs(code);
561
+ code = ResolveCrsAlias(code);
562
+
563
+ // A projected or derived CRS has no DATUM_CODE and inherits the datum of its BASE_CRS_CODE, which can be
564
+ // derived too: 6358 (NAVD88 depth (ftUS)) -> 6360 (NAVD88 height (ftUS)) -> 5703 (NAVD88 height).
565
+ auto datumCode = _provider->GetDatumCodeForCrs(code);
566
+ for (auto baseCrsCode = code, depth = 0; 0 == datumCode && depth < 8; ++depth)
567
+ {
568
+ baseCrsCode = _provider->GetGeographicCrsCodeForProjectedCrs(baseCrsCode);
569
+ if (0 == baseCrsCode)
570
+ break;
571
+ datumCode = _provider->GetDatumCodeForCrs(baseCrsCode);
572
+ }
573
+ return datumCode;
551
574
  }
552
575
 
553
576
  auto CoordinateSystemAuthorityFactory::GetNameOfDatum(int code) const -> std::string
@@ -632,6 +655,7 @@ namespace CrsKit::Epsg
632
655
 
633
656
  auto CoordinateSystemAuthorityFactory::CreateGeographic2DSystemForGeographic3DSystem(int code, AxisInfo const& axisX, AxisInfo const& axisY) const -> std::shared_ptr<GeographicCoordinateSystem>
634
657
  {
658
+ code = ResolveCrsAlias(code);
635
659
  #ifdef _DEBUG
636
660
  auto const coordinateSystemType = _provider->GetCoordinateSystemType(code);
637
661
  assert(0 == compareNoCase(coordinateSystemType.c_str(), "geographic 3D"));
@@ -644,6 +668,7 @@ namespace CrsKit::Epsg
644
668
 
645
669
  auto CoordinateSystemAuthorityFactory::FindGeographicSystem3D(int code, AxisInfo const& axisX, AxisInfo const& axisY) const -> std::shared_ptr<GeographicCoordinateSystem>
646
670
  {
671
+ code = ResolveCrsAlias(code);
647
672
  #ifdef _DEBUG
648
673
  auto const coordinateSystemType = _provider->GetCoordinateSystemType(code);
649
674
  assert(0 == compareNoCase(coordinateSystemType.c_str(), "geographic 2D"));
@@ -28,6 +28,52 @@ namespace CrsKit::CoordinateSystems
28
28
  return GetDefaultContext()->parsePolicy == WktParsePolicy::CatalogWins;
29
29
  }
30
30
 
31
+ // The PROJCS and VERTCS texts of an ESRI compound: "PROJCS[...],VERTCS[...]", or the VERTCS nested as the
32
+ // last child of the PROJCS, whose closing bracket then goes back to the PROJCS.
33
+ auto SplitEsriCompound(std::string const& wkt) -> std::pair<std::string, std::string>
34
+ {
35
+ auto const start = wkt.find(",VERTCS");
36
+ if (std::string::npos == start)
37
+ return { wkt, {} };
38
+ auto horizontal = wkt.substr(0, start);
39
+ auto vertical = wkt.substr(start + 1);
40
+ if (std::ranges::count(vertical, '[') < std::ranges::count(vertical, ']') && vertical.ends_with(']'))
41
+ {
42
+ vertical.pop_back();
43
+ horizontal += ']';
44
+ }
45
+ return { horizontal, vertical };
46
+ }
47
+
48
+ auto FindCrsAlias(Wkt::TokenWkt const& node) -> std::optional<int>
49
+ {
50
+ auto const context = GetDefaultContext();
51
+ auto const& aliases = context->aliases;
52
+ if (aliases.IsEmpty())
53
+ return std::nullopt;
54
+
55
+ // Local/engineering and compound CRS are never aliased (a compound is resolved by its components).
56
+ for (auto const* excluded : { "LOCAL_CS", "ENGCRS", "ENGINEERINGCRS", "COMPD_CS", "COMPOUNDCRS" })
57
+ if (0 == compareNoCase(node.GetName().c_str(), excluded))
58
+ return std::nullopt;
59
+
60
+ auto hasId = false;
61
+ for (auto const* keyword : { "ID", "AUTHORITY" })
62
+ {
63
+ if (!node.HasChild(keyword))
64
+ continue;
65
+ hasId = true;
66
+ auto const& id = node.GetChild(keyword);
67
+ if (auto const code = aliases.FindCrs(id.GetChild(0).GetString(), Wkt::ReadAuthorityCode(id.GetChild(1))))
68
+ return code;
69
+ }
70
+
71
+ // A name alias applies only to a node without AUTHORITY/ID.
72
+ if (hasId || 0 == node.GetChildCount())
73
+ return std::nullopt;
74
+ return aliases.FindCrsByName(node.GetChild(0).GetString());
75
+ }
76
+
31
77
  auto CoordinateSystemFactory::CreateFrom(Wkt::TokenWkt const& token) -> std::shared_ptr<CoordinateSystem>
32
78
  {
33
79
  // WKT2 (ISO 19162) strings are recognised by their root keyword (GEOGCRS/PROJCRS/...) and parsed
@@ -65,8 +111,9 @@ namespace CrsKit::CoordinateSystems
65
111
  // ESRI-flavoured WKT that carries an EPSG code resolves from the catalogue by that code (a clean
66
112
  // EPSG object rather than the ArcGIS names), regardless of the parse policy and never by matching
67
113
  // ESRI names. The ESRI compound (a VERTCS embedded in the PROJCS) is handled by the block below.
114
+ // An alias (CrsContext::aliases) on the ID/AUTHORITY or the name stands in for the EPSG code.
68
115
  if (EsriProjectionEngine::LooksLikeEsri(root) && !EsriProjectionEngine::IsEsriCompound(root))
69
- if (auto const code = Wkt::EpsgCode(root); 0 != code)
116
+ if (auto const code = FindCrsAlias(root).value_or(Wkt::EpsgCode(root)); 0 != code)
70
117
  return GetCoordinateSystemAuthorityFactory()->CreateCoordinateSystem(code);
71
118
 
72
119
  // ESRI stores a compound CRS as a VERTCS embedded in the PROJCS. When both parts carry an EPSG code
@@ -74,10 +121,18 @@ namespace CrsKit::CoordinateSystems
74
121
  // structure -- VDATUM, Vertical_Shift -- that we cannot build from its pieces, so a compound without
75
122
  // codes falls through to the horizontal-only parse below.)
76
123
  if (EsriProjectionEngine::IsEsriCompound(root))
77
- if (auto const horizontalCode = Wkt::EpsgCode(root), verticalCode = Wkt::EpsgCode(root.GetChild("VERTCS")); 0 != horizontalCode && 0 != verticalCode)
124
+ {
125
+ // A VERTCS without code is looked up by its text in the ESRI table.
126
+ auto const& vertcs = root.GetChild("VERTCS");
127
+ auto verticalCode = FindCrsAlias(vertcs).value_or(Wkt::EpsgCode(vertcs));
128
+ if (0 == verticalCode)
129
+ verticalCode = EsriProjectionEngine::FindVerticalEpsgCode(SplitEsriCompound(wkt).second);
130
+ if (auto const horizontalCode = FindCrsAlias(root).value_or(Wkt::EpsgCode(root)); 0 != horizontalCode && 0 != verticalCode)
78
131
  return GetCoordinateSystemAuthorityFactory()->CreateCompoundCoordinateSystem(horizontalCode, verticalCode);
132
+ }
79
133
 
80
- if (CatalogWins() && root.GetName() == "PROJCS")
134
+ // The ESRI name lookup below is a catalogue query, so it does not run for a CRS that has an alias.
135
+ if (CatalogWins() && root.GetName() == "PROJCS" && !FindCrsAlias(root))
81
136
  {
82
137
  // The system may be Esri, compound or projected.
83
138
  //
@@ -88,20 +143,12 @@ namespace CrsKit::CoordinateSystems
88
143
  // the option to create OpenGIS-compatible systems is set, and therefore the name it will be assigned
89
144
  // this reference system will be the ArcInfo name and not the ArcGis name, which is the one the user expects to see.
90
145
  std::string verticalWkt;
91
- for (auto i = 0u; i < deserializadorWkt.GetRootNode().GetChildCount(); i++)
92
- {
93
- if (deserializadorWkt.GetRootNode().GetChild(i).GetName() == "VERTCS")
94
- {
95
- // It is an Esri system and also has a vertical component
96
- auto const comienzo = wkt.find(",VERTCS");
97
- verticalWkt = wkt.substr(wkt.size() - comienzo - 1);
98
- wkt = wkt.substr(0,comienzo);
99
- break;
100
- }
101
- }
146
+ if (root.HasChild("VERTCS"))
147
+ std::tie(wkt, verticalWkt) = SplitEsriCompound(wkt);
102
148
 
103
149
  auto const horizontalEpsgCode = EsriProjectionEngine::FindHorizontalEpsgCode(wkt);
104
- auto const verticalEpsgCode = EsriProjectionEngine::FindVerticalEpsgCode(verticalWkt);
150
+ auto const verticalAlias = root.HasChild("VERTCS") ? FindCrsAlias(root.GetChild("VERTCS")) : std::nullopt;
151
+ auto const verticalEpsgCode = verticalAlias ? *verticalAlias : EsriProjectionEngine::FindVerticalEpsgCode(verticalWkt);
105
152
  if (0 != horizontalEpsgCode)
106
153
  {
107
154
  if (0 != verticalEpsgCode)
@@ -188,6 +235,18 @@ namespace CrsKit::CoordinateSystems
188
235
  return CreateUnknownCompound();
189
236
  }
190
237
 
238
+ namespace
239
+ {
240
+ // Every axis of the CRS, the height of a geographic 3D CRS included.
241
+ auto AxesOf(CoordinateSystem const& coordinateSystem) -> std::vector<AxisInfo>
242
+ {
243
+ std::vector<AxisInfo> axes;
244
+ for (auto i = 0; i < coordinateSystem.GetDimension(); ++i)
245
+ axes.push_back(coordinateSystem.GetAxis(i));
246
+ return axes;
247
+ }
248
+ }
249
+
191
250
  auto CoordinateSystemFactory::WithAxesEastNorth(std::shared_ptr<CoordinateSystem> const& coordinateSystem) -> std::shared_ptr<CoordinateSystem>
192
251
  {
193
252
  if (coordinateSystem->GetAxis(0).GetOrientation() == AxisOrientationEnum::East &&
@@ -196,8 +255,7 @@ namespace CrsKit::CoordinateSystems
196
255
 
197
256
  if (auto const geographic = dynamic_pointer_cast<GeographicCoordinateSystem>(coordinateSystem); nullptr != geographic)
198
257
  {
199
- std::vector<AxisInfo> axis;
200
- axis.resize(coordinateSystem->GetDimension());
258
+ auto axis = AxesOf(*coordinateSystem);
201
259
  axis[0] = AxisInfo("Lon", AxisOrientationEnum::East);
202
260
  axis[1] = AxisInfo("Lat", AxisOrientationEnum::North);
203
261
 
@@ -241,8 +299,7 @@ namespace CrsKit::CoordinateSystems
241
299
  auto const geographic = dynamic_pointer_cast<GeographicCoordinateSystem>(coordinateSystem);
242
300
  if (nullptr != geographic)
243
301
  {
244
- std::vector<AxisInfo> axis;
245
- axis.resize(2);
302
+ auto axis = AxesOf(*coordinateSystem);
246
303
  axis[0] = AxisInfo("Lat", AxisOrientationEnum::North);
247
304
  axis[1] = AxisInfo("Lon", AxisOrientationEnum::East);
248
305
 
@@ -22,6 +22,9 @@ namespace CrsKit::CoordinateSystems
22
22
 
23
23
  auto GeocentricCoordinateSystem::FromWkt(Wkt::TokenWkt const& tokenGEOCCS) -> std::shared_ptr<GeocentricCoordinateSystem>
24
24
  {
25
+ if (auto const alias = FindCrsAlias(tokenGEOCCS))
26
+ return GetCoordinateSystemAuthorityFactory()->CreateGeocentricCoordinateSystem(*alias);
27
+
25
28
  auto const [authority, authorityCode] = Wkt::ReadAuthority(tokenGEOCCS);
26
29
 
27
30
  if (CatalogWins() && 0 == compareNoCase(authority.c_str(), "EPSG"))
@@ -1,4 +1,5 @@
1
1
  #include "pch.h"
2
+ #include <numbers>
2
3
  #include "BaseInfo.h"
3
4
  #include "CoordinateSystem.h"
4
5
  #include "HorizontalDatum.h"
@@ -24,6 +25,14 @@ namespace CrsKit::CoordinateSystems
24
25
 
25
26
  auto GeographicCoordinateSystem::FromWkt(Wkt::TokenWkt const& tokenGEOGCS) -> std::shared_ptr<GeographicCoordinateSystem>
26
27
  {
28
+ if (auto const alias = FindCrsAlias(tokenGEOGCS))
29
+ {
30
+ auto const axis = AxisInfo::FromWkt(tokenGEOGCS);
31
+ if (axis.empty())
32
+ return GetCoordinateSystemAuthorityFactory()->CreateGeographicCoordinateSystem(*alias);
33
+ return GetCoordinateSystemAuthorityFactory()->CreateGeographicCoordinateSystem(*alias, axis);
34
+ }
35
+
27
36
  auto const [authority, authorityCode] = Wkt::ReadAuthority(tokenGEOGCS);
28
37
 
29
38
  if (!authority.empty())
@@ -41,10 +50,10 @@ namespace CrsKit::CoordinateSystems
41
50
  else if (CatalogWins())
42
51
  {
43
52
  // No AUTHORITY node: we try to recognise the CRS by name and use the catalogue version.
44
- // BUT a datum carrying explicit TOWGS84 parameters is taken at face value: snapping it to a
45
- // same-named catalogue entry would drop the Bursa-Wolf parameters the caller supplied, so we
46
- // keep the WKT definition as-is.
47
- if (!tokenGEOGCS.GetChild(1).HasChild("TOWGS84"))
53
+ // A datum carrying explicit TOWGS84 parameters is kept as-is, because snapping drops them,
54
+ // unless CrsContext::snapEsriNameWithTowgs84 is set and MatchesCatalogueDefinition holds.
55
+ auto const hasTowgs84 = tokenGEOGCS.GetChild(1).HasChild("TOWGS84");
56
+ if (!hasTowgs84)
48
57
  {
49
58
  // We check whether it is of type EsriProjectionEngine
50
59
  auto const epsgCode = EsriProjectionEngine::FindHorizontalEpsgCodeByName(tokenGEOGCS.GetChild(0).GetString());
@@ -59,6 +68,11 @@ namespace CrsKit::CoordinateSystems
59
68
  return GetCoordinateSystemAuthorityFactory()->CreateGeographicCoordinateSystem(epsgCode, axis);
60
69
  }
61
70
  }
71
+ else if (GetDefaultContext()->snapEsriNameWithTowgs84)
72
+ {
73
+ if (auto system = SnapEsriNameWithTowgs84(tokenGEOGCS))
74
+ return system;
75
+ }
62
76
  }
63
77
 
64
78
  // Position 1 of a GEOGCS must be DATUM
@@ -109,6 +123,58 @@ namespace CrsKit::CoordinateSystems
109
123
  units);
110
124
  }
111
125
 
126
+ auto GeographicCoordinateSystem::SnapEsriNameWithTowgs84(Wkt::TokenWkt const& tokenGEOGCS) -> std::shared_ptr<GeographicCoordinateSystem>
127
+ {
128
+ auto const epsgCode = EsriProjectionEngine::FindHorizontalEpsgCodeByName(tokenGEOGCS.GetChild(0).GetString());
129
+ if (0 == epsgCode)
130
+ return {};
131
+
132
+ try
133
+ {
134
+ auto const axis = AxisInfo::FromWkt(tokenGEOGCS);
135
+ auto system = axis.empty()
136
+ ? GetCoordinateSystemAuthorityFactory()->CreateGeographicCoordinateSystem(epsgCode)
137
+ : GetCoordinateSystemAuthorityFactory()->CreateGeographicCoordinateSystem(epsgCode, axis);
138
+ return MatchesCatalogueDefinition(tokenGEOGCS, *system) ? system : nullptr;
139
+ }
140
+ catch (std::exception const&)
141
+ {
142
+ // The ESRI name belongs to a CRS of another type (a projected CRS, for instance): build from the text.
143
+ return {};
144
+ }
145
+ }
146
+
147
+ auto GeographicCoordinateSystem::MatchesCatalogueDefinition(Wkt::TokenWkt const& tokenGEOGCS, IGeographicCoordinateSystem const& system) -> bool
148
+ {
149
+ if (tokenGEOGCS.GetChildCount() < 4)
150
+ return false;
151
+
152
+ auto const& datum = tokenGEOGCS.GetChild(1);
153
+ auto const& meridian = tokenGEOGCS.GetChild(2);
154
+ if (datum.GetChildCount() < 2 || compareNoCase(datum.GetChild(1).GetName().c_str(), "SPHEROID") || compareNoCase(meridian.GetName().c_str(), "PRIMEM"))
155
+ return false;
156
+
157
+ auto const& spheroid = datum.GetChild(1);
158
+ if (spheroid.GetChildCount() < 3 || meridian.GetChildCount() < 2)
159
+ return false;
160
+
161
+ // The semi-major axis is in metres. The prime meridian is read in degrees, as PrimeMeridian::FromWkt reads
162
+ // it and as ESRI writes it even when the GEOGCS unit is the grad.
163
+ auto const semiMajorAxis = spheroid.GetChild(1).GetDouble();
164
+ auto const inverseFlattening = spheroid.GetChild(2).GetDouble();
165
+ auto const meridianRadians = meridian.GetChild(1).GetDouble() * std::numbers::pi / 180.0;
166
+ auto const radiansPerUnit = AngularUnit::FromWkt(tokenGEOGCS.GetChild(3)).GetRadiansPerUnit();
167
+
168
+ auto const& ellipsoid = system.GetHorizontalDatum()->GetEllipsoid();
169
+ auto const systemMeridian = system.GetPrimeMeridian();
170
+ auto const systemRadiansPerUnit = system.GetAngularUnit().GetRadiansPerUnit();
171
+
172
+ return fabs(ellipsoid.GetSemiMajorAxis() * ellipsoid.GetLinearUnit().GetMetersPerUnit() - semiMajorAxis) <= 1e-2
173
+ && fabs(ellipsoid.GetInverseFlattening() - inverseFlattening) <= 1e-4
174
+ && fabs(systemMeridian.GetLongitude() * systemMeridian.GetAngularUnit().GetRadiansPerUnit() - meridianRadians) <= 1e-8
175
+ && fabs(systemRadiansPerUnit - radiansPerUnit) <= 1e-9 * systemRadiansPerUnit;
176
+ }
177
+
112
178
  auto GeographicCoordinateSystem::GetAngularUnit() const -> AngularUnit
113
179
  {
114
180
  return _angularUnit;
@@ -21,6 +21,12 @@ namespace CrsKit::CoordinateSystems
21
21
  public:
22
22
  GeographicCoordinateSystem(std::string const& name, std::string const& authority, int authorityCode, std::string const& alias, std::string const& info, AngularUnit const& angularUnit, std::shared_ptr<IHorizontalDatum> const& horizontalDatum, PrimeMeridian const& primeMeridian, std::vector<AxisInfo> const& axis, std::vector<AnyUnit> const& units);
23
23
  static auto FromWkt(Wkt::TokenWkt const& token) -> std::shared_ptr<GeographicCoordinateSystem>;
24
+ // True when the SPHEROID, PRIMEM and UNIT of a WKT1 GEOGCS node match those of 'system'. The tolerances
25
+ // (1 cm on the semi-major axis, 1e-4 on the inverse flattening) accept the rounded values ESRI writes.
26
+ static auto MatchesCatalogueDefinition(Wkt::TokenWkt const& tokenGEOGCS, IGeographicCoordinateSystem const& system) -> bool;
27
+ // The catalogue CRS of the ESRI name of a GEOGCS whose datum carries TOWGS84, when MatchesCatalogueDefinition
28
+ // holds; null when the name is unknown, is not a geographic CRS or the definition differs.
29
+ static auto SnapEsriNameWithTowgs84(Wkt::TokenWkt const& tokenGEOGCS) -> std::shared_ptr<GeographicCoordinateSystem>;
24
30
  #pragma region GeographicCoordinateSystem members
25
31
 
26
32
  public:
@@ -38,6 +38,9 @@ namespace CrsKit::CoordinateSystems
38
38
  axis[1] = AxisInfo("Y", AxisOrientationEnum::North);
39
39
  }
40
40
 
41
+ if (auto const alias = FindCrsAlias(tokenPROJCS))
42
+ return GetCoordinateSystemAuthorityFactory()->CreateProjectedCoordinateSystem(*alias, axis);
43
+
41
44
  if (!authority.empty())
42
45
  {
43
46
  if (CatalogWins() && 0 == compareNoCase(authority.c_str(), "EPSG"))
@@ -46,10 +49,11 @@ namespace CrsKit::CoordinateSystems
46
49
  else if (CatalogWins())
47
50
  {
48
51
  // No AUTHORITY node: we try to recognise the CRS by name and use the catalogue version.
49
- // BUT a datum carrying explicit TOWGS84 parameters is taken at face value: snapping it to a
50
- // same-named catalogue entry would drop the Bursa-Wolf parameters the caller supplied, so we
51
- // keep the WKT definition as-is. The datum sits at PROJCS -> GEOGCS -> DATUM.
52
- if (!tokenPROJCS.GetChild(1).GetChild(1).HasChild("TOWGS84"))
52
+ // A datum carrying explicit TOWGS84 parameters is kept as-is, because snapping drops them,
53
+ // unless CrsContext::snapEsriNameWithTowgs84 is set, the ESRI name of the GEOGCS is that of the
54
+ // catalogue base CRS and its definition matches. The datum sits at PROJCS -> GEOGCS -> DATUM.
55
+ auto const& tokenGEOGCS = tokenPROJCS.GetChild(1);
56
+ if (!tokenGEOGCS.GetChild(1).HasChild("TOWGS84"))
53
57
  {
54
58
  // We check whether it is of type EsriProjectionEngine
55
59
  auto const epsgCode = EsriProjectionEngine::FindHorizontalEpsgCodeByName(tokenPROJCS.GetChild(0).GetString());
@@ -57,6 +61,26 @@ namespace CrsKit::CoordinateSystems
57
61
  if (0 != epsgCode)
58
62
  return GetCoordinateSystemAuthorityFactory()->CreateProjectedCoordinateSystem(epsgCode, axis);
59
63
  }
64
+ else if (GetDefaultContext()->snapEsriNameWithTowgs84)
65
+ {
66
+ auto const epsgCode = EsriProjectionEngine::FindHorizontalEpsgCodeByName(tokenPROJCS.GetChild(0).GetString());
67
+ auto const geographicCode = EsriProjectionEngine::FindHorizontalEpsgCodeByName(tokenGEOGCS.GetChild(0).GetString());
68
+
69
+ if (0 != epsgCode && 0 != geographicCode)
70
+ {
71
+ try
72
+ {
73
+ auto system = GetCoordinateSystemAuthorityFactory()->CreateProjectedCoordinateSystem(epsgCode, axis);
74
+ auto const base = system->GetGeographicCoordinateSystem();
75
+ if (base && base->GetAuthorityCode() == geographicCode && GeographicCoordinateSystem::MatchesCatalogueDefinition(tokenGEOGCS, *base))
76
+ return system;
77
+ }
78
+ catch (std::exception const&)
79
+ {
80
+ // The ESRI name belongs to a CRS of another type: build from the text.
81
+ }
82
+ }
83
+ }
60
84
  }
61
85
 
62
86
  // Position 1 of a PROJCS must be GEOGCS
@@ -22,6 +22,9 @@ namespace CrsKit::CoordinateSystems
22
22
 
23
23
  auto VerticalCoordinateSystem::FromWkt(Wkt::TokenWkt const& tokenVERTCS) -> std::shared_ptr<VerticalCoordinateSystem>
24
24
  {
25
+ if (auto const alias = FindCrsAlias(tokenVERTCS))
26
+ return GetCoordinateSystemAuthorityFactory()->CreateVerticalCoordinateSystem(*alias);
27
+
25
28
  auto const [authority, authorityCode] = Wkt::ReadAuthority(tokenVERTCS);
26
29
 
27
30
  if (!authority.empty())