crskit 0.5.0__tar.gz → 0.7.0__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.
- {crskit-0.5.0 → crskit-0.7.0}/.github/workflows/epsg.yml +2 -2
- {crskit-0.5.0 → crskit-0.7.0}/CMakeLists.txt +6 -1
- {crskit-0.5.0 → crskit-0.7.0}/PKG-INFO +1 -1
- {crskit-0.5.0 → crskit-0.7.0}/Readme.md +35 -1
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/CompoundCoordinateSystem.cpp +5 -3
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/CoordinateSystem.h +10 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/CoordinateSystemAuthorityFactory.cpp +126 -71
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/CoordinateSystemEquivalence.cpp +14 -8
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/CoordinateSystemFactory.cpp +76 -19
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/Ellipsoid.cpp +6 -3
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/Ellipsoid.h +1 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/GeocentricCoordinateSystem.cpp +14 -4
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/GeographicCoordinateSystem.cpp +70 -4
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/GeographicCoordinateSystem.h +6 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/ProjectedCoordinateSystem.cpp +28 -4
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/Projection.cpp +1 -1
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/Projection.h +21 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/VerticalCoordinateSystem.cpp +3 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/Wkt2.cpp +250 -8
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Affine.cpp +10 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Afine.h +2 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/AlbersConicEqualArea.cpp +1 -1
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/AmericanPolyconic.cpp +3 -3
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/Authalic.h +61 -0
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/AzimuthalProjections.cpp +251 -0
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/AzimuthalProjections.h +84 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/CassiniSoldner.cpp +7 -4
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/CylindricalProjections.cpp +309 -0
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/CylindricalProjections.h +130 -0
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/Geodesic.h +218 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/HotineObliqueMercator.cpp +8 -4
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/Krovak.cpp +160 -0
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/Krovak.h +66 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/LambertAzimuthalEqualArea.cpp +46 -15
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/LambertAzimuthalEqualArea.h +1 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/LambertConformalConic1SP.cpp +1 -1
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/LambertConformalConic2SP.cpp +1 -1
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/LambertConicConformalVariants.cpp +153 -0
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/LambertConicConformalVariants.h +81 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/MapProjectionBase.cpp +28 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/MapProjectionBase.h +14 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Mercator1Sp.cpp +1 -1
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Mercator2Sp.cpp +1 -1
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/ObliqueMercator.cpp +12 -19
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/ObliqueStereographic.cpp +1 -1
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/OtherProjections.cpp +430 -0
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/OtherProjections.h +131 -0
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/PolarStereographic.cpp +133 -0
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/PolarStereographic.h +57 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/PopularVisualisationPseudoMercator.cpp +2 -2
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/TransverseMercator.cpp +1 -1
- crskit-0.7.0/crskit/CoordinateTransformations/Algorithms/TransverseMercatorSouthOrientated.cpp +64 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/TransverseMercatorSouthOrientated.h +6 -23
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/CoordinateTransformationAuthorityFactory.cpp +63 -35
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/CoordinateTransformationFactory.cpp +143 -70
- crskit-0.7.0/crskit/CoordinateTransformations/MathTransformRegistry.cpp +592 -0
- crskit-0.7.0/crskit/CrsAliases.cpp +172 -0
- crskit-0.7.0/crskit/CrsAliases.h +84 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CrsContext.h +11 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/EsriProjectionEngine.cpp +84 -83
- {crskit-0.5.0 → crskit-0.7.0}/crskit/EsriProjectionEngine.h +3 -2
- {crskit-0.5.0 → crskit-0.7.0}/crskit/ExtensionManager.cpp +2 -2
- {crskit-0.5.0 → crskit-0.7.0}/crskit/IAuthorityProvider.h +12 -1
- {crskit-0.5.0 → crskit-0.7.0}/crskit/IUtilities.h +11 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/OpenGisAttributes.h +3 -1
- {crskit-0.5.0 → crskit-0.7.0}/crskit/SqliteProvider.h +66 -49
- {crskit-0.5.0 → crskit-0.7.0}/crskit/TokenWkt.cpp +13 -1
- {crskit-0.5.0 → crskit-0.7.0}/crskit/TokenWkt.h +3 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Utilities.cpp +70 -108
- {crskit-0.5.0 → crskit-0.7.0}/crskit/WktDeserializer.cpp +19 -2
- {crskit-0.5.0 → crskit-0.7.0}/ports/crskit/portfile.cmake +1 -1
- {crskit-0.5.0 → crskit-0.7.0}/ports/crskit/vcpkg.json +1 -1
- {crskit-0.5.0 → crskit-0.7.0}/pyproject.toml +1 -1
- crskit-0.7.0/tests/TestAmericanPolyconic.cpp +22 -0
- crskit-0.7.0/tests/TestAntimeridian.cpp +44 -0
- crskit-0.7.0/tests/TestAzimuthalProjections.cpp +90 -0
- crskit-0.7.0/tests/TestCassiniSoldner.cpp +40 -0
- crskit-0.7.0/tests/TestCatalogueSweep.cpp +221 -0
- crskit-0.7.0/tests/TestCompoundFromWkt.cpp +114 -0
- crskit-0.7.0/tests/TestCrsAliases.cpp +483 -0
- crskit-0.7.0/tests/TestCylindricalProjections.cpp +50 -0
- crskit-0.7.0/tests/TestDatabaseErrors.cpp +287 -0
- crskit-0.7.0/tests/TestDatumOfCrs.cpp +23 -0
- crskit-0.7.0/tests/TestEsriCompound.cpp +37 -0
- crskit-0.7.0/tests/TestEsriTables.cpp +58 -0
- crskit-0.7.0/tests/TestEsriTowgs84Snap.cpp +176 -0
- crskit-0.7.0/tests/TestGeocentricOperations.cpp +45 -0
- crskit-0.7.0/tests/TestGeocentricWkt.cpp +46 -0
- crskit-0.7.0/tests/TestHeaderWarnings.cpp +25 -0
- crskit-0.7.0/tests/TestKrovak.cpp +69 -0
- crskit-0.7.0/tests/TestLambertAzimuthalEqualArea.cpp +57 -0
- crskit-0.7.0/tests/TestLambertConicConformalVariants.cpp +53 -0
- crskit-0.7.0/tests/TestNonNumericAuthority.cpp +55 -0
- crskit-0.7.0/tests/TestObliqueMercator.cpp +77 -0
- crskit-0.7.0/tests/TestOtherProjections.cpp +98 -0
- crskit-0.7.0/tests/TestPolarStereographic.cpp +113 -0
- crskit-0.7.0/tests/TestProjectionParameters.cpp +45 -0
- crskit-0.7.0/tests/TestSexagesimalDms.cpp +74 -0
- crskit-0.7.0/tests/TestUnknownCrs.cpp +176 -0
- crskit-0.7.0/tests/TestUtilitiesContract.cpp +91 -0
- crskit-0.7.0/tests/TestWestSouthAxes.cpp +38 -0
- crskit-0.7.0/tests/TestWithAxes.cpp +31 -0
- crskit-0.7.0/tests/TestWktMalformed.cpp +12 -0
- crskit-0.7.0/tests/TestWktQuoted.cpp +110 -0
- crskit-0.7.0/tests/TestWktUnclosed.cpp +38 -0
- {crskit-0.5.0 → crskit-0.7.0}/tools/release.sh +13 -0
- {crskit-0.5.0 → crskit-0.7.0}/versions/baseline.json +1 -1
- {crskit-0.5.0 → crskit-0.7.0}/versions/c-/crskit.json +10 -0
- crskit-0.5.0/crskit/CoordinateTransformations/Algorithms/TransverseMercatorSouthOrientated.cpp +0 -102
- crskit-0.5.0/crskit/CoordinateTransformations/MathTransformRegistry.cpp +0 -305
- crskit-0.5.0/tests/TestUnknownCrs.cpp +0 -80
- {crskit-0.5.0 → crskit-0.7.0}/.gitattributes +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/.github/workflows/ci.yml +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/.github/workflows/wheels.yml +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/.gitignore +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/CMakePresets.json +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/LICENSE +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/branding/crskit-logo-128.png +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/branding/crskit-logo-256.png +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/branding/crskit-logo-512.png +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/branding/crskit-logo-64.png +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/branding/crskit-logo.svg +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/branding/crskit.ico +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/cmake/crskit-config.cmake.in +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/AngularUnit.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/AngularUnit.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/AxisInfo.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/AxisOrientationEnum.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/BaseInfo.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/CompoundCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/CoordinateSystem.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/CoordinateSystemAuthorityFactory.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/CoordinateSystemFactory.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/Datum.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/Datum.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/DatumType.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/GeocentricCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/HorizontalCoordinateSystem.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/HorizontalCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/HorizontalDatum.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/HorizontalDatum.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/ICompoundCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/ICoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/ICoordinateSystemAuthorityFactory.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/IDatum.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/IGeocentricCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/IGeographicCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/IHorizontalCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/IHorizontalDatum.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/IInfo.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/ILocalCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/ILocalDatum.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/IProjectedCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/IProjection.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/IVerticalCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/IVerticalDatum.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/LinearUnit.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/LinearUnit.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/LocalCoordinateSystem.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/LocalCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/LocalDatum.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/LocalDatum.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/PrimeMeridian.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/PrimeMeridian.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/ProjectedCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/Unit.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/VerticalCoordinateSystem.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/VerticalDatum.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/VerticalDatum.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/Wgs84ConversionInfo.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateSystems/Wkt2.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformationOptions.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/AlbersConicEqualArea.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/AmericanPolyconic.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/CassiniSoldner.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/CoordinateFrameRotation.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/CoordinateFrameRotation.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GeocentricToTopocentric.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GeocentricToTopocentric.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GeocentricTranslations.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GeocentricTranslations.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Geographic2D2Geocentric.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Geographic2D2Geocentric.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Geographic2D2Geographic3D.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Geographic2D2Geographic3D.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Geographic3DToGravityRelatedHeightEGM.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Geographic3DToGravityRelatedHeightEGM.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Geographic3DToGravityRelatedHeightEGM2008.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Geographic3DToGravityRelatedHeightEGM2008.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridAusGeoid.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridAusGeoid.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridEGM2008.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridEGM2008.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridEGM2008Rednap.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridEGM2008Rednap.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridGtg.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridGtg.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridGtx.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/GridGtx.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/Inflate.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/GridFiles/Inflate.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/HotineObliqueMercator.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/LambertConformalConic1SP.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/LambertConformalConic2SP.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/LongitudeRotation.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/LongitudeRotation.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Mercator1Sp.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Mercator2Sp.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/MolodenskyBadekas.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/MolodenskyBadekas.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/NadCon.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/NadCon.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Ntv2.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/Ntv2.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/ObliqueMercator.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/ObliqueStereographic.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/P6.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/P6.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/PopularVisualisationPseudoMercator.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/PositionVectorTransformation.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/PositionVectorTransformation.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/TransverseMercator.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/VerticalOffset.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Algorithms/VerticalOffset.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/ConcatenatedTransform.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/ConcatenatedTransform.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/CoordinateOperation.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/CoordinateTransformation.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/CoordinateTransformation.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/CoordinateTransformationAuthorityFactory.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/CoordinateTransformationFactory.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/DomainFlags.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/ICoordinateTransformation.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/ICoordinateTransformationAuthorityFactory.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/ICoordinateTransformationFactory.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/IMathTransform.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/IMathTransformFactory.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/MathTransformBase.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/MathTransformBase.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/MathTransformFactory.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/MathTransformFactory.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/MathTransformRegistry.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Passthrough.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/Passthrough.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/TransformType.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CoordinateTransformations/UnitsOfMeasure.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CrsKit.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/CrsKitExport.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/ExtensionManager.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Factory.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/GridFileNotFoundException.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Mathematics/Angles.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Mathematics/Concepts.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Mathematics/GridCell.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Mathematics/GridInterpolation.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Mathematics/Interpolation.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Mathematics/Matrix.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Mathematics/Point.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Mathematics/Window2D.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/OpenGisException.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Parameter.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Positioning/Envelope.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/StringUtil.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/Utilities.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/WktDeserializer.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/app.ico +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/pch.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/crskit/pch.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/data/grid-sources.json +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/external/sqlite/sqlite3.c +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/external/sqlite/sqlite3.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/CMakeLists.txt +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/README.md +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/TUTORIAL.de.md +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/TUTORIAL.es.md +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/TUTORIAL.fr.md +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/TUTORIAL.it.md +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/TUTORIAL.md +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/crskit/__init__.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/crskit/_crskit.pyi +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/crskit/py.typed +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/examples/01_quickstart.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/examples/02_wkt.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/examples/03_point_cloud.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/examples/04_choosing_the_operation.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/examples/05_orthometric_heights.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/examples/06_global_geoid.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/examples/README.md +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/examples/_setup.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/src/module.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/tests/test_crskit.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python/tests/test_examples.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python-epsg/README.md +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python-epsg/crskit_epsg/EPSG-TERMS-OF-USE.md +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python-epsg/crskit_epsg/__init__.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python-epsg/fetch.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/python-epsg/pyproject.toml +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5101Part2.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5101Part3.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5101Part4.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5102Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5102Part2.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5103Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5103Part2.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5103Part3.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5104Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5105Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5105Part2.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5106Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5107Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5108Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5109Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5110Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5111Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5111Part2.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5112Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5113Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5201Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5203Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5204Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5205Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5205Part2.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5207Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5207Part2.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5208Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5209Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part10.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part11.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part12.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part2.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part3.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part4.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part5.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part6.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part7.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part8.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5210Part9.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5212Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Gigs/Test5213Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/GigsFactory.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/Test5101Part1.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestBase.h +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestContextEnvironment.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestEnvironment.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestEquivalence.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestExceptions.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestGridCell.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestGridFile.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestOperationSelection.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestProjectionEdges.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestTowgs84.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestTransformPoints.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestTransformationAuthorityCode.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/TestWkt2.cpp +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tests/vcpkg.json +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tools/epsg-sqlite/README.md +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/tools/epsg-sqlite/epsg_sql_to_sqlite.py +0 -0
- {crskit-0.5.0 → crskit-0.7.0}/vcpkg.json +0 -0
|
@@ -15,11 +15,11 @@ on:
|
|
|
15
15
|
required: true
|
|
16
16
|
default: https://github.com/digi21/crskit/releases/download/epsg-data/epsg-v12.057.sqlite
|
|
17
17
|
publish:
|
|
18
|
-
description: "Publish
|
|
18
|
+
description: "Publish it (untick to only build the package and inspect the artifact)"
|
|
19
19
|
type: boolean
|
|
20
20
|
default: true
|
|
21
21
|
production:
|
|
22
|
-
description: "Publish to the REAL PyPI
|
|
22
|
+
description: "Publish to the REAL PyPI. Irreversible. Leave unticked to publish to TestPyPI."
|
|
23
23
|
type: boolean
|
|
24
24
|
default: false
|
|
25
25
|
|
|
@@ -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
|
|
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.
|
|
3
|
+
Version: 0.7.0
|
|
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,11 +70,18 @@ namespace CrsKit::Epsg
|
|
|
60
70
|
|
|
61
71
|
auto CoordinateSystemAuthorityFactory::CreateProjectedCoordinateSystem(int code) const -> std::shared_ptr<ProjectedCoordinateSystem>
|
|
62
72
|
{
|
|
63
|
-
|
|
73
|
+
code = ResolveCrsAlias(code);
|
|
74
|
+
// ProjectedCoordinateSystem holds two axes: a projected 3D CRS (EPSG 9895, with ellipsoidal height) is rejected.
|
|
75
|
+
auto const axis = CreateAxisInformation(code);
|
|
76
|
+
if (axis.size() > 2)
|
|
77
|
+
throw UnsupportedFormatException(std::format("The projected coordinate system {} has {} axes; only projected systems with 2 axes are supported.", code, axis.size()));
|
|
78
|
+
|
|
79
|
+
return CreateProjectedCoordinateSystem(code, axis);
|
|
64
80
|
}
|
|
65
81
|
|
|
66
82
|
auto CoordinateSystemAuthorityFactory::CreateProjectedCoordinateSystem(int code, std::vector<AxisInfo> const& axis) const -> std::shared_ptr<ProjectedCoordinateSystem>
|
|
67
83
|
{
|
|
84
|
+
code = ResolveCrsAlias(code);
|
|
68
85
|
auto const coordinateSystemName = _provider->GetCoordinateReferenceSystemName(code, IsEsri(GetDefaultContext()->wktVersion));
|
|
69
86
|
if (coordinateSystemName.empty())
|
|
70
87
|
throw AuthorityCodeNotFoundException(std::format("Could not locate the coordinate system with code: {}", code) );
|
|
@@ -73,10 +90,12 @@ namespace CrsKit::Epsg
|
|
|
73
90
|
if (0 != compareNoCase(coordinateSystemType.c_str(), "projected"))
|
|
74
91
|
throw runtime_error( std::format("The {} coordinate system is not projected.", code) );
|
|
75
92
|
|
|
76
|
-
|
|
93
|
+
if (axis.size() != 2)
|
|
94
|
+
throw UnsupportedFormatException(std::format("A projected coordinate system takes 2 axes, not {}.", axis.size()));
|
|
77
95
|
|
|
78
96
|
auto const units = CreateUnitsInformation(code);
|
|
79
|
-
|
|
97
|
+
if (units.empty())
|
|
98
|
+
throw OpenGisException(std::format("The coordinate system of the projected CRS {} has no axis unit.", code));
|
|
80
99
|
|
|
81
100
|
auto geographicCoordinateSystem = CreateGeographicCoordinateSystem(_provider->GetGeographicCrsCodeForProjectedCrs(code));
|
|
82
101
|
auto const operationCode = _provider->GetOperationCodeForCrs(code);
|
|
@@ -98,6 +117,7 @@ namespace CrsKit::Epsg
|
|
|
98
117
|
|
|
99
118
|
auto CoordinateSystemAuthorityFactory::CreateProjectedCoordinateSystem(int projectionCode, int geographicCrsCode) const -> std::shared_ptr<ProjectedCoordinateSystem>
|
|
100
119
|
{
|
|
120
|
+
geographicCrsCode = ResolveCrsAlias(geographicCrsCode);
|
|
101
121
|
auto const maximum = _provider->GetProjectedCrsCountFromProjConvCodeAndBaseCrsCode(projectionCode, geographicCrsCode);
|
|
102
122
|
if (0 == maximum)
|
|
103
123
|
throw runtime_error("No projected coordinate system with the specified parameters has been located." );
|
|
@@ -140,19 +160,21 @@ namespace CrsKit::Epsg
|
|
|
140
160
|
return CreateLinearUnit(code);
|
|
141
161
|
return CreateAngularUnit(code);
|
|
142
162
|
}
|
|
143
|
-
catch (
|
|
163
|
+
catch (std::exception const& e)
|
|
144
164
|
{
|
|
145
|
-
throw
|
|
165
|
+
throw OpenGisException(std::format("An error was found when creating the unit with authority code {}: {}", code, e.what()));
|
|
146
166
|
}
|
|
147
167
|
}
|
|
148
168
|
|
|
149
169
|
auto CoordinateSystemAuthorityFactory::CreateGeographicCoordinateSystem(int code) const -> std::shared_ptr<GeographicCoordinateSystem>
|
|
150
170
|
{
|
|
171
|
+
code = ResolveCrsAlias(code);
|
|
151
172
|
return CreateGeographicCoordinateSystem(code, CreateAxisInformation(code));
|
|
152
173
|
}
|
|
153
174
|
|
|
154
175
|
auto CoordinateSystemAuthorityFactory::CreateGeographicCoordinateSystem(int code, std::vector<AxisInfo> const& axis) const -> std::shared_ptr<GeographicCoordinateSystem>
|
|
155
176
|
{
|
|
177
|
+
code = ResolveCrsAlias(code);
|
|
156
178
|
auto const coordinateSystemName = _provider->GetCoordinateReferenceSystemName(code, IsEsri(GetDefaultContext()->wktVersion));
|
|
157
179
|
if (coordinateSystemName.empty())
|
|
158
180
|
throw AuthorityCodeNotFoundException(std::format("Unable to locate coordinate system with authority code: {}", code) );
|
|
@@ -185,9 +207,9 @@ namespace CrsKit::Epsg
|
|
|
185
207
|
axis,
|
|
186
208
|
units);
|
|
187
209
|
}
|
|
188
|
-
catch (
|
|
210
|
+
catch (OpenGisException const& e)
|
|
189
211
|
{
|
|
190
|
-
throw
|
|
212
|
+
throw OpenGisException(std::format("An error was found when creating the coordinate system {}: {}", code, e.what()));
|
|
191
213
|
}
|
|
192
214
|
}
|
|
193
215
|
|
|
@@ -220,9 +242,9 @@ namespace CrsKit::Epsg
|
|
|
220
242
|
CreateEllipsoid(_provider->GetEllipsoidCodeForDatum(code)),
|
|
221
243
|
ResolveWgs84ConversionInfo(code));
|
|
222
244
|
}
|
|
223
|
-
catch (
|
|
245
|
+
catch (std::exception const& e)
|
|
224
246
|
{
|
|
225
|
-
throw
|
|
247
|
+
throw OpenGisException(std::format("An error was found when creating the datum with authority code {}: {}", code, e.what()));
|
|
226
248
|
}
|
|
227
249
|
}
|
|
228
250
|
|
|
@@ -237,40 +259,41 @@ namespace CrsKit::Epsg
|
|
|
237
259
|
constexpr int kPositionVector = 9606;
|
|
238
260
|
constexpr int kCoordinateFrame = 9607;
|
|
239
261
|
|
|
240
|
-
//
|
|
241
|
-
|
|
262
|
+
// nullptr when the datum has no Helmert transformation to WGS 84. A database failure throws.
|
|
263
|
+
auto const geographicCrs = _provider->GetGeographicCrsCodeForDatum(datumCode);
|
|
264
|
+
if (0 == geographicCrs || kWgs84GeographicCrs == geographicCrs)
|
|
265
|
+
return nullptr; // No geographic CRS for the datum, or the datum is WGS 84 itself.
|
|
266
|
+
|
|
267
|
+
// Candidates are already ordered by accuracy (best first) and exclude deprecated operations.
|
|
268
|
+
for (auto const& operation : _provider->OperationCodesToTransformSystemAtoB(geographicCrs, kWgs84GeographicCrs))
|
|
242
269
|
{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
return nullptr; // No geographic CRS for the datum, or the datum is WGS 84 itself.
|
|
270
|
+
if (kGeocentricTranslations != operation.MethodCode && kPositionVector != operation.MethodCode && kCoordinateFrame != operation.MethodCode)
|
|
271
|
+
continue; // Grid- or Molodensky-based transformations cannot be written as TOWGS84.
|
|
246
272
|
|
|
247
|
-
|
|
248
|
-
|
|
273
|
+
auto const parameters = _provider->GetTransformationParameters(operation.Code, operation.MethodCode);
|
|
274
|
+
auto const value = [&](size_t i)
|
|
249
275
|
{
|
|
250
|
-
if (
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
catch (...)
|
|
273
|
-
{
|
|
276
|
+
if (i >= parameters.size())
|
|
277
|
+
return 0.0;
|
|
278
|
+
if (!std::holds_alternative<double>(parameters[i]))
|
|
279
|
+
throw OpenGisException(std::format("Parameter {} of the transformation {} is not a number.", i, operation.Code));
|
|
280
|
+
return std::get<double>(parameters[i]);
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
if (kGeocentricTranslations == operation.MethodCode)
|
|
284
|
+
return std::make_shared<Wgs84ConversionInfo>(value(0), value(1), value(2), 0.0, 0.0, 0.0, 0.0);
|
|
285
|
+
|
|
286
|
+
// The provider returns rotations in decimal degrees, but TOWGS84 (Wgs84ConversionInfo)
|
|
287
|
+
// expresses them in arc-seconds, so we scale them up. 9606 is already Position Vector;
|
|
288
|
+
// 9607 (Coordinate Frame) is the same shift with the opposite rotation sign, so we also
|
|
289
|
+
// negate the rotations to emit Position Vector, the convention WKT 1 TOWGS84 follows in
|
|
290
|
+
// GDAL/PROJ. Translations (metres) and scale (ppm) need no conversion.
|
|
291
|
+
constexpr double kDegreesToArcSeconds = 3600.0;
|
|
292
|
+
auto const rotationFactor = ((kCoordinateFrame == operation.MethodCode) ? -1.0 : 1.0) * kDegreesToArcSeconds;
|
|
293
|
+
return std::make_shared<Wgs84ConversionInfo>(
|
|
294
|
+
value(0), value(1), value(2),
|
|
295
|
+
rotationFactor * value(3), rotationFactor * value(4), rotationFactor * value(5),
|
|
296
|
+
value(6));
|
|
274
297
|
}
|
|
275
298
|
|
|
276
299
|
return nullptr;
|
|
@@ -306,9 +329,9 @@ namespace CrsKit::Epsg
|
|
|
306
329
|
_provider->GetSemiMinorAxis(code),
|
|
307
330
|
CreateLinearUnit(_provider->GetEllipsoidLinearUnit(code)));
|
|
308
331
|
}
|
|
309
|
-
catch (
|
|
332
|
+
catch (OpenGisException const& e)
|
|
310
333
|
{
|
|
311
|
-
throw
|
|
334
|
+
throw OpenGisException(std::format("An error was found when creating the ellipsoid with authority code {}: {}", code, e.what()));
|
|
312
335
|
}
|
|
313
336
|
}
|
|
314
337
|
|
|
@@ -329,9 +352,9 @@ namespace CrsKit::Epsg
|
|
|
329
352
|
CreateAngularUnit(_provider->GetMeridianAngularUnit(code)),
|
|
330
353
|
_provider->GetMeridianLongitude(code)};
|
|
331
354
|
}
|
|
332
|
-
catch (
|
|
355
|
+
catch (std::exception const& e)
|
|
333
356
|
{
|
|
334
|
-
throw
|
|
357
|
+
throw OpenGisException(std::format("An error was found when creating the meridian with authority code {}: {}", code, e.what()));
|
|
335
358
|
}
|
|
336
359
|
}
|
|
337
360
|
|
|
@@ -351,9 +374,9 @@ namespace CrsKit::Epsg
|
|
|
351
374
|
_provider->GetUnitInfo(code),
|
|
352
375
|
_provider->GetFactorToStandardUnit(code)};
|
|
353
376
|
}
|
|
354
|
-
catch (
|
|
377
|
+
catch (std::exception const& e)
|
|
355
378
|
{
|
|
356
|
-
throw
|
|
379
|
+
throw OpenGisException(std::format("An error was found when creating the linear unit with authority code {}: {}", code, e.what()));
|
|
357
380
|
}
|
|
358
381
|
}
|
|
359
382
|
|
|
@@ -373,9 +396,9 @@ namespace CrsKit::Epsg
|
|
|
373
396
|
_provider->GetUnitInfo(code),
|
|
374
397
|
_provider->GetFactorToStandardUnit(code)};
|
|
375
398
|
}
|
|
376
|
-
catch (
|
|
399
|
+
catch (std::exception const& e)
|
|
377
400
|
{
|
|
378
|
-
throw
|
|
401
|
+
throw OpenGisException(std::format("An error was found when creating the angular unit with authority code {}: {}", code, e.what()));
|
|
379
402
|
}
|
|
380
403
|
}
|
|
381
404
|
|
|
@@ -395,14 +418,15 @@ namespace CrsKit::Epsg
|
|
|
395
418
|
_provider->GetInfoDatum(code),
|
|
396
419
|
DatumType::VD_GeoidModelDerived);
|
|
397
420
|
}
|
|
398
|
-
catch (
|
|
421
|
+
catch (std::exception const& e)
|
|
399
422
|
{
|
|
400
|
-
throw
|
|
423
|
+
throw OpenGisException(std::format("An error was found when creating the datum with authority code {}: {}", code, e.what()));
|
|
401
424
|
}
|
|
402
425
|
}
|
|
403
426
|
|
|
404
427
|
auto CoordinateSystemAuthorityFactory::CreateVerticalCoordinateSystem(int code) const -> std::shared_ptr<VerticalCoordinateSystem>
|
|
405
428
|
{
|
|
429
|
+
code = ResolveCrsAlias(code);
|
|
406
430
|
auto const coordinateSystemName = _provider->GetCoordinateReferenceSystemName(code, IsEsri(GetDefaultContext()->wktVersion));
|
|
407
431
|
if (coordinateSystemName.empty())
|
|
408
432
|
throw AuthorityCodeNotFoundException(std::format("Unable to locate coordinate system with authority code: {}", code));
|
|
@@ -415,17 +439,7 @@ namespace CrsKit::Epsg
|
|
|
415
439
|
|
|
416
440
|
auto const axis = CreateAxisInformation(code);
|
|
417
441
|
auto const units = CreateUnitsInformation(code);
|
|
418
|
-
auto
|
|
419
|
-
if (0 == datumCode)
|
|
420
|
-
{
|
|
421
|
-
// CRS vertical derivado (p.ej. EPSG 5706 "Caspian depth" deriva de 5611
|
|
422
|
-
// "Caspian height" via an axis-direction-reversal conversion): the
|
|
423
|
-
// DATUM_CODE field is NULL and the datum is inherited from the base CRS (BASE_CRS_CODE).
|
|
424
|
-
auto const baseCrsCode = _provider->GetGeographicCrsCodeForProjectedCrs(code);
|
|
425
|
-
if (0 != baseCrsCode)
|
|
426
|
-
datumCode = _provider->GetDatumCodeForCrs(baseCrsCode);
|
|
427
|
-
}
|
|
428
|
-
auto const verticalDatum = CreateVerticalDatum(datumCode);
|
|
442
|
+
auto const verticalDatum = CreateVerticalDatum(GetCodeOfDatumAssociatedWithCrs(code));
|
|
429
443
|
|
|
430
444
|
return make_shared<VerticalCoordinateSystem>(
|
|
431
445
|
coordinateSystemName,
|
|
@@ -437,14 +451,15 @@ namespace CrsKit::Epsg
|
|
|
437
451
|
dynamic_pointer_cast<VerticalDatum>(verticalDatum),
|
|
438
452
|
axis[0]);
|
|
439
453
|
}
|
|
440
|
-
catch (
|
|
454
|
+
catch (OpenGisException const& e)
|
|
441
455
|
{
|
|
442
|
-
throw
|
|
456
|
+
throw OpenGisException(std::format("An error was found when creating the coordinate system {}: {}", code, e.what()));
|
|
443
457
|
}
|
|
444
458
|
}
|
|
445
459
|
|
|
446
460
|
auto CoordinateSystemAuthorityFactory::CreateGeocentricCoordinateSystem(int code) const -> std::shared_ptr<GeocentricCoordinateSystem>
|
|
447
461
|
{
|
|
462
|
+
code = ResolveCrsAlias(code);
|
|
448
463
|
auto const coordinateSystemName = _provider->GetCoordinateReferenceSystemName(code, IsEsri(GetDefaultContext()->wktVersion));
|
|
449
464
|
if (coordinateSystemName.empty())
|
|
450
465
|
throw AuthorityCodeNotFoundException(std::format("Unable to locate coordinate system with authority code: {}", code));
|
|
@@ -474,14 +489,15 @@ namespace CrsKit::Epsg
|
|
|
474
489
|
axis[1],
|
|
475
490
|
axis[2]);
|
|
476
491
|
}
|
|
477
|
-
catch (
|
|
492
|
+
catch (OpenGisException const& e)
|
|
478
493
|
{
|
|
479
|
-
throw
|
|
494
|
+
throw OpenGisException(std::format("An error was found when creating the coordinate system {}: {}", code, e.what()));
|
|
480
495
|
}
|
|
481
496
|
}
|
|
482
497
|
|
|
483
498
|
auto CoordinateSystemAuthorityFactory::CreateHorizontalCoordinateSystem(int code) const -> std::shared_ptr<HorizontalCoordinateSystem>
|
|
484
499
|
{
|
|
500
|
+
code = ResolveCrsAlias(code);
|
|
485
501
|
// We check whether it is projected or geographic
|
|
486
502
|
auto const coordinateSystemType = _provider->GetCoordinateSystemType(code);
|
|
487
503
|
if (0 == compareNoCase(coordinateSystemType.c_str(), "projected"))
|
|
@@ -504,16 +520,19 @@ namespace CrsKit::Epsg
|
|
|
504
520
|
|
|
505
521
|
auto CoordinateSystemAuthorityFactory::GetKindOfCoordinateSystem(int code) const->std::string
|
|
506
522
|
{
|
|
523
|
+
code = ResolveCrsAlias(code);
|
|
507
524
|
return _provider->GetCoordinateSystemType(code);
|
|
508
525
|
}
|
|
509
526
|
|
|
510
527
|
auto CoordinateSystemAuthorityFactory::GetDescriptionAreaApplicationCrs(int code) const -> std::string
|
|
511
528
|
{
|
|
529
|
+
code = ResolveCrsAlias(code);
|
|
512
530
|
return _provider->GetApplicationAreaDescription(code);
|
|
513
531
|
}
|
|
514
532
|
|
|
515
533
|
auto CoordinateSystemAuthorityFactory::GetCodeOfCoordinateSystemAssociatedWithCrs(int code) const -> int
|
|
516
534
|
{
|
|
535
|
+
code = ResolveCrsAlias(code);
|
|
517
536
|
return _provider->GetCoordinateSystemCodeForCrs(code);
|
|
518
537
|
}
|
|
519
538
|
|
|
@@ -539,7 +558,19 @@ namespace CrsKit::Epsg
|
|
|
539
558
|
|
|
540
559
|
auto CoordinateSystemAuthorityFactory::GetCodeOfDatumAssociatedWithCrs(int code) const -> int
|
|
541
560
|
{
|
|
542
|
-
|
|
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;
|
|
543
574
|
}
|
|
544
575
|
|
|
545
576
|
auto CoordinateSystemAuthorityFactory::GetNameOfDatum(int code) const -> std::string
|
|
@@ -585,15 +616,37 @@ namespace CrsKit::Epsg
|
|
|
585
616
|
|
|
586
617
|
auto CoordinateSystemAuthorityFactory::CreateProjection(int operationCode, int algorithmCode) const -> std::shared_ptr<IProjection>
|
|
587
618
|
{
|
|
588
|
-
auto const clase =
|
|
619
|
+
auto const clase = [&]
|
|
620
|
+
{
|
|
621
|
+
try
|
|
622
|
+
{
|
|
623
|
+
return ExtensionManager::FindMathematicalOperation("EPSG", algorithmCode);
|
|
624
|
+
}
|
|
625
|
+
catch (UnsupportedFormatException const&)
|
|
626
|
+
{
|
|
627
|
+
throw UnsupportedFormatException(std::format("The projection method EPSG:{} '{}' of the conversion {} is not implemented.", algorithmCode, _provider->GetAlgorithmName(algorithmCode), operationCode));
|
|
628
|
+
}
|
|
629
|
+
}();
|
|
589
630
|
auto const classParameters = ExtensionManager::GetMathOperationParameters(clase);
|
|
590
|
-
auto const parameterValues = _provider->
|
|
631
|
+
auto const parameterValues = _provider->GetOperationParameters(operationCode, algorithmCode);
|
|
591
632
|
|
|
633
|
+
// Each value goes to the class parameter with its EPSG code. A provider without codes (code 0) is mapped by
|
|
634
|
+
// position, which relies on the class declaring its parameters in EPSG sort order.
|
|
592
635
|
vector<CrsKit::Parameter> parameters;
|
|
593
|
-
parameters.resize(classParameters.size());
|
|
594
|
-
|
|
595
636
|
for (auto i = 0u; i < parameterValues.size(); i++)
|
|
596
|
-
|
|
637
|
+
{
|
|
638
|
+
auto const& [code, value] = parameterValues[i];
|
|
639
|
+
auto const it = 0 == code
|
|
640
|
+
? (i < classParameters.size() ? classParameters.begin() + i : classParameters.end())
|
|
641
|
+
: std::ranges::find_if(classParameters, [code](auto const& p) { return p->EpsgCode == code; });
|
|
642
|
+
if (it == classParameters.end())
|
|
643
|
+
throw OpenGisException(std::format("The operation {} has a parameter (EPSG:{}) that the method EPSG:{} does not take.", operationCode, code, algorithmCode));
|
|
644
|
+
|
|
645
|
+
if (ParameterType::String != (*it)->Type && !std::holds_alternative<double>(value))
|
|
646
|
+
throw OpenGisException(std::format("The parameter '{}' of the operation {} has no numeric value.", (*it)->Name, operationCode));
|
|
647
|
+
|
|
648
|
+
parameters.emplace_back((*it)->Name, value);
|
|
649
|
+
}
|
|
597
650
|
|
|
598
651
|
return make_shared<Projection>(
|
|
599
652
|
ExtensionManager::GetClassificationName(clase),
|
|
@@ -602,6 +655,7 @@ namespace CrsKit::Epsg
|
|
|
602
655
|
|
|
603
656
|
auto CoordinateSystemAuthorityFactory::CreateGeographic2DSystemForGeographic3DSystem(int code, AxisInfo const& axisX, AxisInfo const& axisY) const -> std::shared_ptr<GeographicCoordinateSystem>
|
|
604
657
|
{
|
|
658
|
+
code = ResolveCrsAlias(code);
|
|
605
659
|
#ifdef _DEBUG
|
|
606
660
|
auto const coordinateSystemType = _provider->GetCoordinateSystemType(code);
|
|
607
661
|
assert(0 == compareNoCase(coordinateSystemType.c_str(), "geographic 3D"));
|
|
@@ -614,6 +668,7 @@ namespace CrsKit::Epsg
|
|
|
614
668
|
|
|
615
669
|
auto CoordinateSystemAuthorityFactory::FindGeographicSystem3D(int code, AxisInfo const& axisX, AxisInfo const& axisY) const -> std::shared_ptr<GeographicCoordinateSystem>
|
|
616
670
|
{
|
|
671
|
+
code = ResolveCrsAlias(code);
|
|
617
672
|
#ifdef _DEBUG
|
|
618
673
|
auto const coordinateSystemType = _provider->GetCoordinateSystemType(code);
|
|
619
674
|
assert(0 == compareNoCase(coordinateSystemType.c_str(), "geographic 2D"));
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
#include "VerticalDatum.h"
|
|
4
4
|
#include "LocalDatum.h"
|
|
5
|
+
#include "Projection.h"
|
|
5
6
|
|
|
6
7
|
// Structural equivalence of coordinate systems: two systems are equivalent when their mathematical
|
|
7
8
|
// definition matches (datum, prime meridian, projection + parameters, units), ignoring name,
|
|
@@ -36,11 +37,8 @@ namespace CrsKit::CoordinateSystems
|
|
|
36
37
|
b.GetLongitude() * b.GetAngularUnit().GetRadiansPerUnit());
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
auto
|
|
40
|
+
auto sameValue(Parameter const& a, Parameter const& b) -> bool
|
|
40
41
|
{
|
|
41
|
-
if (0 != compareNoCase(a.GetName().c_str(), b.GetName().c_str()))
|
|
42
|
-
return false;
|
|
43
|
-
|
|
44
42
|
auto const va = a.GetValue();
|
|
45
43
|
auto const vb = b.GetValue();
|
|
46
44
|
if (va.index() != vb.index())
|
|
@@ -61,10 +59,18 @@ namespace CrsKit::CoordinateSystems
|
|
|
61
59
|
auto const& pb = b->GetParameters();
|
|
62
60
|
if (pa.size() != pb.size())
|
|
63
61
|
return false;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
// Each parameter of one has one with the same name and value in the other, both ways (a repeated name must not
|
|
63
|
+
// stand for a missing one), whatever the order; ParameterNamesMatch: GDAL writes standard_parallel_1, the registry
|
|
64
|
+
// standard_parallel1.
|
|
65
|
+
auto const allIn = [](std::vector<Parameter> const& from, std::vector<Parameter> const& in)
|
|
66
|
+
{
|
|
67
|
+
return std::ranges::all_of(from, [&](Parameter const& p)
|
|
68
|
+
{
|
|
69
|
+
auto const it = std::ranges::find_if(in, [&](Parameter const& q) { return ParameterNamesMatch(p.GetName(), q.GetName()); });
|
|
70
|
+
return it != in.end() && sameValue(p, *it);
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
return allIn(pa, pb) && allIn(pb, pa);
|
|
68
74
|
}
|
|
69
75
|
}
|
|
70
76
|
|