diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-11-14 17:40:42 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-11-14 22:48:29 +0100 |
| commit | d928db15d53805d9b728b440079756081961c536 (patch) | |
| tree | e862a961d26bedb34c58e4f28ef0bdeedb5f3225 /include/proj/internal | |
| parent | 330e8bf686f9c4524075ca1ff50cbca6c9e091da (diff) | |
| download | PROJ-d928db15d53805d9b728b440079756081961c536.tar.gz PROJ-d928db15d53805d9b728b440079756081961c536.zip | |
Implement RFC 2: Initial integration of "GDAL SRS barn" work
This work mostly consists of:
- a C++ implementation of the ISO-19111:2018 / OGC Topic 2
"Referencing by coordinates" classes to represent Datums,
Coordinate systems, CRSs (Coordinate Reference Systems) and
Coordinate Operations.
- methods to convert between this C++ modeling and WKT1, WKT2
and PROJ string representations of those objects
- management and query of a SQLite3 database of CRS and Coordinate Operation definition
- a C API binding part of those capabilities
This is all-in-one squashed commit of the work of
https://github.com/OSGeo/proj.4/pull/1040
Diffstat (limited to 'include/proj/internal')
| -rw-r--r-- | include/proj/internal/Makefile.am | 8 | ||||
| -rw-r--r-- | include/proj/internal/coordinateoperation_constants.hpp | 898 | ||||
| -rw-r--r-- | include/proj/internal/coordinateoperation_internal.hpp | 274 | ||||
| -rw-r--r-- | include/proj/internal/coordinatesystem_internal.hpp | 104 | ||||
| -rw-r--r-- | include/proj/internal/esri_projection_mappings.hpp | 887 | ||||
| -rw-r--r-- | include/proj/internal/internal.hpp | 190 | ||||
| -rw-r--r-- | include/proj/internal/io_internal.hpp | 163 | ||||
| -rw-r--r-- | include/proj/internal/lru_cache.hpp | 223 |
8 files changed, 2747 insertions, 0 deletions
diff --git a/include/proj/internal/Makefile.am b/include/proj/internal/Makefile.am new file mode 100644 index 00000000..ddd2686c --- /dev/null +++ b/include/proj/internal/Makefile.am @@ -0,0 +1,8 @@ +noinst_HEADERS = \ + coordinateoperation_constants.hpp \ + coordinateoperation_internal.hpp \ + esri_projection_mappings.hpp \ + coordinatesystem_internal.hpp \ + internal.hpp \ + io_internal.hpp \ + lru_cache.hpp diff --git a/include/proj/internal/coordinateoperation_constants.hpp b/include/proj/internal/coordinateoperation_constants.hpp new file mode 100644 index 00000000..e999b3a6 --- /dev/null +++ b/include/proj/internal/coordinateoperation_constants.hpp @@ -0,0 +1,898 @@ +/****************************************************************************** + * + * Project: PROJ + * Purpose: ISO19111:2018 implementation + * Author: Even Rouault <even dot rouault at spatialys dot com> + * + ****************************************************************************** + * Copyright (c) 2018, Even Rouault <even dot rouault at spatialys dot com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ****************************************************************************/ + +#ifndef FROM_COORDINATE_OPERATION_CPP +#error This file should only be included from coordinateoperation.cpp +#endif + +#ifndef COORDINATEOPERATION_CONSTANTS_HH_INCLUDED +#define COORDINATEOPERATION_CONSTANTS_HH_INCLUDED + +#include "coordinateoperation_internal.hpp" +#include "proj_constants.h" + +//! @cond Doxygen_Suppress +// --------------------------------------------------------------------------- + +// anonymous namespace +namespace { + +using namespace ::NS_PROJ; +using namespace ::NS_PROJ::operation; + +static const char *WKT1_LATITUDE_OF_ORIGIN = "latitude_of_origin"; +static const char *WKT1_CENTRAL_MERIDIAN = "central_meridian"; +static const char *WKT1_SCALE_FACTOR = "scale_factor"; +static const char *WKT1_FALSE_EASTING = "false_easting"; +static const char *WKT1_FALSE_NORTHING = "false_northing"; +static const char *WKT1_STANDARD_PARALLEL_1 = "standard_parallel_1"; +static const char *WKT1_STANDARD_PARALLEL_2 = "standard_parallel_2"; +static const char *WKT1_LATITUDE_OF_CENTER = "latitude_of_center"; +static const char *WKT1_LONGITUDE_OF_CENTER = "longitude_of_center"; +static const char *WKT1_AZIMUTH = "azimuth"; +static const char *WKT1_RECTIFIED_GRID_ANGLE = "rectified_grid_angle"; + +static const char *lat_0 = "lat_0"; +static const char *lat_1 = "lat_1"; +static const char *lat_2 = "lat_2"; +static const char *lat_ts = "lat_ts"; +static const char *lon_0 = "lon_0"; +static const char *lon_1 = "lon_1"; +static const char *lon_2 = "lon_2"; +static const char *lonc = "lonc"; +static const char *alpha = "alpha"; +static const char *gamma = "gamma"; +static const char *k_0 = "k_0"; +static const char *k = "k"; +static const char *x_0 = "x_0"; +static const char *y_0 = "y_0"; +static const char *h = "h"; + +static const ParamMapping paramLatitudeNatOrigin = { + EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, WKT1_LATITUDE_OF_ORIGIN, + common::UnitOfMeasure::Type::ANGULAR, lat_0}; + +static const ParamMapping paramLongitudeNatOrigin = { + EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, WKT1_CENTRAL_MERIDIAN, + common::UnitOfMeasure::Type::ANGULAR, lon_0}; + +static const ParamMapping paramScaleFactor = { + EPSG_NAME_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, WKT1_SCALE_FACTOR, + common::UnitOfMeasure::Type::SCALE, k_0}; + +static const ParamMapping paramFalseEasting = { + EPSG_NAME_PARAMETER_FALSE_EASTING, EPSG_CODE_PARAMETER_FALSE_EASTING, + WKT1_FALSE_EASTING, common::UnitOfMeasure::Type::LINEAR, x_0}; + +static const ParamMapping paramFalseNorthing = { + EPSG_NAME_PARAMETER_FALSE_NORTHING, EPSG_CODE_PARAMETER_FALSE_NORTHING, + WKT1_FALSE_NORTHING, common::UnitOfMeasure::Type::LINEAR, y_0}; + +static const ParamMapping paramLatitudeFalseOrigin = { + EPSG_NAME_PARAMETER_LATITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_FALSE_ORIGIN, WKT1_LATITUDE_OF_ORIGIN, + common::UnitOfMeasure::Type::ANGULAR, lat_0}; + +static const ParamMapping paramLongitudeFalseOrigin = { + EPSG_NAME_PARAMETER_LONGITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_FALSE_ORIGIN, WKT1_CENTRAL_MERIDIAN, + common::UnitOfMeasure::Type::ANGULAR, lon_0}; + +static const ParamMapping paramFalseEastingOrigin = { + EPSG_NAME_PARAMETER_EASTING_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_EASTING_FALSE_ORIGIN, WKT1_FALSE_EASTING, + common::UnitOfMeasure::Type::LINEAR, x_0}; + +static const ParamMapping paramFalseNorthingOrigin = { + EPSG_NAME_PARAMETER_NORTHING_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_NORTHING_FALSE_ORIGIN, WKT1_FALSE_NORTHING, + common::UnitOfMeasure::Type::LINEAR, y_0}; + +static const ParamMapping paramLatitude1stStdParallel = { + EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, WKT1_STANDARD_PARALLEL_1, + common::UnitOfMeasure::Type::ANGULAR, lat_1}; + +static const ParamMapping paramLatitude2ndStdParallel = { + EPSG_NAME_PARAMETER_LATITUDE_2ND_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_2ND_STD_PARALLEL, WKT1_STANDARD_PARALLEL_2, + common::UnitOfMeasure::Type::ANGULAR, lat_2}; + +static const ParamMapping *const paramsNatOriginScale[] = { + ¶mLatitudeNatOrigin, ¶mLongitudeNatOrigin, ¶mScaleFactor, + ¶mFalseEasting, ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramLatFirstPoint = { + "Latitude of 1st point", 0, "Latitude_Of_1st_Point", + common::UnitOfMeasure::Type::ANGULAR, lat_1}; +static const ParamMapping paramLongFirstPoint = { + "Longitude of 1st point", 0, "Longitude_Of_1st_Point", + common::UnitOfMeasure::Type::ANGULAR, lon_1}; +static const ParamMapping paramLatSecondPoint = { + "Latitude of 2nd point", 0, "Latitude_Of_2nd_Point", + common::UnitOfMeasure::Type::ANGULAR, lat_2}; +static const ParamMapping paramLongSecondPoint = { + "Longitude of 2nd point", 0, "Longitude_Of_2nd_Point", + common::UnitOfMeasure::Type::ANGULAR, lon_2}; + +static const ParamMapping *const paramsTPEQD[] = {¶mLatFirstPoint, + ¶mLongFirstPoint, + ¶mLatSecondPoint, + ¶mLongSecondPoint, + ¶mFalseEasting, + ¶mFalseNorthing, + nullptr}; + +static const ParamMapping *const paramsTMG[] = { + ¶mLatitudeFalseOrigin, ¶mLongitudeFalseOrigin, + ¶mFalseEastingOrigin, ¶mFalseNorthingOrigin, nullptr}; + +static const ParamMapping paramLatFalseOriginLatOfCenter = { + EPSG_NAME_PARAMETER_LATITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_FALSE_ORIGIN, WKT1_LATITUDE_OF_CENTER, + common::UnitOfMeasure::Type::ANGULAR, lat_0}; + +static const ParamMapping paramLongFalseOriginLongOfCenter = { + EPSG_NAME_PARAMETER_LONGITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_FALSE_ORIGIN, WKT1_LONGITUDE_OF_CENTER, + common::UnitOfMeasure::Type::ANGULAR, lon_0}; + +static const ParamMapping *const paramsAEA[] = { + ¶mLatFalseOriginLatOfCenter, + ¶mLongFalseOriginLongOfCenter, + ¶mLatitude1stStdParallel, + ¶mLatitude2ndStdParallel, + ¶mFalseEastingOrigin, + ¶mFalseNorthingOrigin, + nullptr}; + +static const ParamMapping *const paramsLCC2SP[] = { + ¶mLatitudeFalseOrigin, + ¶mLongitudeFalseOrigin, + ¶mLatitude1stStdParallel, + ¶mLatitude2ndStdParallel, + ¶mFalseEastingOrigin, + ¶mFalseNorthingOrigin, + nullptr, +}; + +static const ParamMapping paramEllipsoidScaleFactor = { + EPSG_NAME_PARAMETER_ELLIPSOID_SCALE_FACTOR, + EPSG_CODE_PARAMETER_ELLIPSOID_SCALE_FACTOR, nullptr, + common::UnitOfMeasure::Type::SCALE, k_0}; + +static const ParamMapping *const paramsLCC2SPMichigan[] = { + ¶mLatitudeFalseOrigin, ¶mLongitudeFalseOrigin, + ¶mLatitude1stStdParallel, ¶mLatitude2ndStdParallel, + ¶mFalseEastingOrigin, ¶mFalseNorthingOrigin, + ¶mEllipsoidScaleFactor, nullptr, +}; + +static const ParamMapping paramLatNatLatCenter = { + EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, WKT1_LATITUDE_OF_CENTER, + common::UnitOfMeasure::Type::ANGULAR, lat_0}; + +static const ParamMapping paramLonNatLonCenter = { + EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, WKT1_LONGITUDE_OF_CENTER, + common::UnitOfMeasure::Type::ANGULAR, lon_0}; + +static const ParamMapping *const paramsAEQD[]{ + ¶mLatNatLatCenter, ¶mLonNatLonCenter, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping *const paramsNatOrigin[] = { + ¶mLatitudeNatOrigin, ¶mLongitudeNatOrigin, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramLatNatOriginLat1 = { + EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, WKT1_STANDARD_PARALLEL_1, + common::UnitOfMeasure::Type::ANGULAR, lat_1}; + +static const ParamMapping *const paramsBonne[] = { + ¶mLatNatOriginLat1, ¶mLongitudeNatOrigin, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramLat1stParallelLatTs = { + EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, WKT1_STANDARD_PARALLEL_1, + common::UnitOfMeasure::Type::ANGULAR, lat_ts}; + +static const ParamMapping *const paramsCEA[] = { + ¶mLat1stParallelLatTs, ¶mLongitudeNatOrigin, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping *const paramsEQDC[] = {¶mLatNatLatCenter, + ¶mLonNatLonCenter, + ¶mLatitude1stStdParallel, + ¶mLatitude2ndStdParallel, + ¶mFalseEasting, + ¶mFalseNorthing, + nullptr}; + +static const ParamMapping *const paramsLonNatOrigin[] = { + ¶mLongitudeNatOrigin, ¶mFalseEasting, ¶mFalseNorthing, nullptr}; + +static const ParamMapping *const paramsEqc[] = // same as paramsCEA + {¶mLat1stParallelLatTs, ¶mLongitudeNatOrigin, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramSatelliteHeight = { + "Satellite Height", 0, "satellite_height", + common::UnitOfMeasure::Type::LINEAR, h}; + +static const ParamMapping *const paramsGeos[] = { + ¶mLongitudeNatOrigin, ¶mSatelliteHeight, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramLatCentreLatCenter = { + EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LATITUDE_PROJECTION_CENTRE, WKT1_LATITUDE_OF_CENTER, + common::UnitOfMeasure::Type::ANGULAR, lat_0}; + +static const ParamMapping paramLonCentreLonCenterLonc = { + EPSG_NAME_PARAMETER_LONGITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LONGITUDE_PROJECTION_CENTRE, WKT1_LONGITUDE_OF_CENTER, + common::UnitOfMeasure::Type::ANGULAR, lonc}; + +static const ParamMapping paramLatCentreLatOrigin = { + EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LATITUDE_PROJECTION_CENTRE, WKT1_LATITUDE_OF_ORIGIN, + common::UnitOfMeasure::Type::ANGULAR, lat_0}; + +static const ParamMapping paramAzimuth = { + EPSG_NAME_PARAMETER_AZIMUTH_INITIAL_LINE, + EPSG_CODE_PARAMETER_AZIMUTH_INITIAL_LINE, WKT1_AZIMUTH, + common::UnitOfMeasure::Type::ANGULAR, alpha}; + +static const ParamMapping paramAngleToSkewGrid = { + EPSG_NAME_PARAMETER_ANGLE_RECTIFIED_TO_SKEW_GRID, + EPSG_CODE_PARAMETER_ANGLE_RECTIFIED_TO_SKEW_GRID, WKT1_RECTIFIED_GRID_ANGLE, + common::UnitOfMeasure::Type::ANGULAR, gamma}; +static const ParamMapping paramScaleFactorInitialLine = { + EPSG_NAME_PARAMETER_SCALE_FACTOR_INITIAL_LINE, + EPSG_CODE_PARAMETER_SCALE_FACTOR_INITIAL_LINE, WKT1_SCALE_FACTOR, + common::UnitOfMeasure::Type::SCALE, k}; + +static const ParamMapping *const paramsHomVariantA[] = { + ¶mLatCentreLatCenter, + ¶mLonCentreLonCenterLonc, + ¶mAzimuth, + ¶mAngleToSkewGrid, + ¶mScaleFactorInitialLine, + ¶mFalseEasting, + ¶mFalseNorthing, + nullptr}; + +static const ParamMapping paramFalseEastingProjectionCentre = { + EPSG_NAME_PARAMETER_EASTING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_EASTING_PROJECTION_CENTRE, WKT1_FALSE_EASTING, + common::UnitOfMeasure::Type::LINEAR, x_0}; + +static const ParamMapping paramFalseNorthingProjectionCentre = { + EPSG_NAME_PARAMETER_NORTHING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_NORTHING_PROJECTION_CENTRE, WKT1_FALSE_NORTHING, + common::UnitOfMeasure::Type::LINEAR, y_0}; + +static const ParamMapping *const paramsHomVariantB[] = { + ¶mLatCentreLatCenter, + ¶mLonCentreLonCenterLonc, + ¶mAzimuth, + ¶mAngleToSkewGrid, + ¶mScaleFactorInitialLine, + ¶mFalseEastingProjectionCentre, + ¶mFalseNorthingProjectionCentre, + nullptr}; + +static const ParamMapping paramLatPoint1 = { + "Latitude of 1st point", 0, "latitude_of_point_1", + common::UnitOfMeasure::Type::ANGULAR, lat_1}; + +static const ParamMapping paramLonPoint1 = { + "Longitude of 1st point", 0, "longitude_of_point_1", + common::UnitOfMeasure::Type::ANGULAR, lon_1}; + +static const ParamMapping paramLatPoint2 = { + "Latitude of 2nd point", 0, "latitude_of_point_2", + common::UnitOfMeasure::Type::ANGULAR, lat_2}; + +static const ParamMapping paramLonPoint2 = { + "Longitude of 2nd point", 0, "longitude_of_point_2", + common::UnitOfMeasure::Type::ANGULAR, lon_2}; + +static const ParamMapping *const paramsHomTwoPoint[] = { + ¶mLatCentreLatOrigin, + ¶mLatPoint1, + ¶mLonPoint1, + ¶mLatPoint2, + ¶mLonPoint2, + ¶mScaleFactorInitialLine, + ¶mFalseEastingProjectionCentre, + ¶mFalseNorthingProjectionCentre, + nullptr}; + +static const ParamMapping *const paramsIMWP[] = { + ¶mLongitudeNatOrigin, ¶mLatitude1stStdParallel, + ¶mLatitude2ndStdParallel, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramLonCentreLonCenter = { + EPSG_NAME_PARAMETER_LONGITUDE_OF_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_ORIGIN, WKT1_LONGITUDE_OF_CENTER, + common::UnitOfMeasure::Type::ANGULAR, lon_0}; + +static const ParamMapping paramColatitudeConeAxis = { + EPSG_NAME_PARAMETER_COLATITUDE_CONE_AXIS, + EPSG_CODE_PARAMETER_COLATITUDE_CONE_AXIS, WKT1_AZIMUTH, + common::UnitOfMeasure::Type::ANGULAR, + nullptr}; /* ignored by PROJ currently */ + +static const ParamMapping paramLatitudePseudoStdParallel = { + EPSG_NAME_PARAMETER_LATITUDE_PSEUDO_STANDARD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_PSEUDO_STANDARD_PARALLEL, + "pseudo_standard_parallel_1", common::UnitOfMeasure::Type::ANGULAR, + nullptr}; /* ignored by PROJ currently */ + +static const ParamMapping paramScaleFactorPseudoStdParallel = { + EPSG_NAME_PARAMETER_SCALE_FACTOR_PSEUDO_STANDARD_PARALLEL, + EPSG_CODE_PARAMETER_SCALE_FACTOR_PSEUDO_STANDARD_PARALLEL, + WKT1_SCALE_FACTOR, common::UnitOfMeasure::Type::SCALE, + k}; /* ignored by PROJ currently */ + +static const ParamMapping *const krovakParameters[] = { + ¶mLatCentreLatCenter, + ¶mLonCentreLonCenter, + ¶mColatitudeConeAxis, + ¶mLatitudePseudoStdParallel, + ¶mScaleFactorPseudoStdParallel, + ¶mFalseEasting, + ¶mFalseNorthing, + nullptr}; + +static const ParamMapping *const paramsLaea[] = { + ¶mLatNatLatCenter, ¶mLonNatLonCenter, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping *const paramsMiller[] = { + ¶mLonNatLonCenter, ¶mFalseEasting, ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramLatMerc1SP = { + EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + nullptr, // always set to zero, not to be exported in WKT1 + common::UnitOfMeasure::Type::ANGULAR, + nullptr}; // always set to zero, not to be exported in PROJ strings + +static const ParamMapping paramScaleFactorK = { + EPSG_NAME_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, WKT1_SCALE_FACTOR, + common::UnitOfMeasure::Type::SCALE, k}; + +static const ParamMapping *const paramsMerc1SP[] = { + ¶mLatMerc1SP, ¶mLongitudeNatOrigin, ¶mScaleFactorK, + ¶mFalseEasting, ¶mFalseNorthing, nullptr}; + +static const ParamMapping *const paramsMerc2SP[] = { + ¶mLat1stParallelLatTs, ¶mLongitudeNatOrigin, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping *const paramsObliqueStereo[] = { + ¶mLatitudeNatOrigin, ¶mLongitudeNatOrigin, ¶mScaleFactorK, + ¶mFalseEasting, ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramLatStdParallel = { + EPSG_NAME_PARAMETER_LATITUDE_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_STD_PARALLEL, WKT1_LATITUDE_OF_ORIGIN, + common::UnitOfMeasure::Type::ANGULAR, lat_ts}; + +static const ParamMapping paramsLonOrigin = { + EPSG_NAME_PARAMETER_LONGITUDE_OF_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_ORIGIN, WKT1_CENTRAL_MERIDIAN, + common::UnitOfMeasure::Type::ANGULAR, lon_0}; + +static const ParamMapping *const paramsPolarStereo[] = { + ¶mLatStdParallel, ¶msLonOrigin, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping *const paramsLonNatOriginLongitudeCentre[] = { + ¶mLonNatLonCenter, ¶mFalseEasting, ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramLatTrueScaleWag3 = { + "Latitude of true scale", 0, WKT1_LATITUDE_OF_ORIGIN, + common::UnitOfMeasure::Type::ANGULAR, lat_ts}; + +static const ParamMapping *const paramsWag3[] = { + ¶mLatTrueScaleWag3, ¶mLongitudeNatOrigin, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramPegLat = { + "Peg point latitude", 0, "peg_point_latitude", + common::UnitOfMeasure::Type::ANGULAR, "plat_0"}; + +static const ParamMapping paramPegLon = { + "Peg point longitude", 0, "peg_point_longitude", + common::UnitOfMeasure::Type::ANGULAR, "plon_0"}; + +static const ParamMapping paramPegHeading = { + "Peg point heading", 0, "peg_point_heading", + common::UnitOfMeasure::Type::ANGULAR, "phdg_0"}; + +static const ParamMapping paramPegHeight = { + "Peg point height", 0, "peg_point_height", + common::UnitOfMeasure::Type::LINEAR, "h_0"}; + +static const ParamMapping *const paramsSch[] = { + ¶mPegLat, ¶mPegLon, ¶mPegHeading, ¶mPegHeight, nullptr}; + +static const ParamMapping *const paramsWink1[] = { + ¶mLongitudeNatOrigin, ¶mLat1stParallelLatTs, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping *const paramsWink2[] = { + ¶mLongitudeNatOrigin, ¶mLatitude1stStdParallel, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramLatLoxim = { + EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, WKT1_LATITUDE_OF_ORIGIN, + common::UnitOfMeasure::Type::ANGULAR, lat_1}; + +static const ParamMapping *const paramsLoxim[] = { + ¶mLatLoxim, ¶mLongitudeNatOrigin, ¶mFalseEasting, + ¶mFalseNorthing, nullptr}; + +static const ParamMapping paramLonCentre = { + EPSG_NAME_PARAMETER_LONGITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LONGITUDE_PROJECTION_CENTRE, nullptr, + common::UnitOfMeasure::Type::ANGULAR, lon_0}; + +static const ParamMapping paramLabordeObliqueMercatorAzimuth = { + EPSG_NAME_PARAMETER_AZIMUTH_INITIAL_LINE, + EPSG_CODE_PARAMETER_AZIMUTH_INITIAL_LINE, nullptr, + common::UnitOfMeasure::Type::ANGULAR, "azi"}; + +static const ParamMapping *const paramsLabordeObliqueMercator[] = { + ¶mLatCentreLatOrigin, + ¶mLonCentre, + ¶mLabordeObliqueMercatorAzimuth, + ¶mScaleFactorInitialLine, + ¶mFalseEasting, + ¶mFalseNorthing, + nullptr}; + +static const MethodMapping methodMappings[] = { + {EPSG_NAME_METHOD_TRANSVERSE_MERCATOR, EPSG_CODE_METHOD_TRANSVERSE_MERCATOR, + "Transverse_Mercator", "tmerc", nullptr, paramsNatOriginScale}, + + {EPSG_NAME_METHOD_TRANSVERSE_MERCATOR_SOUTH_ORIENTATED, + EPSG_CODE_METHOD_TRANSVERSE_MERCATOR_SOUTH_ORIENTATED, + "Transverse_Mercator_South_Orientated", "tmerc", "axis=wsu", + paramsNatOriginScale}, + + {PROJ_WKT2_NAME_METHOD_TWO_POINT_EQUIDISTANT, 0, "Two_Point_Equidistant", + "tpeqd", nullptr, paramsTPEQD}, + + {EPSG_NAME_METHOD_TUNISIA_MAPPING_GRID, + EPSG_CODE_METHOD_TUNISIA_MAPPING_GRID, "Tunisia_Mapping_Grid", nullptr, + nullptr, // no proj equivalent + paramsTMG}, + + {EPSG_NAME_METHOD_ALBERS_EQUAL_AREA, EPSG_CODE_METHOD_ALBERS_EQUAL_AREA, + "Albers_Conic_Equal_Area", "aea", nullptr, paramsAEA}, + + {EPSG_NAME_METHOD_LAMBERT_CONIC_CONFORMAL_1SP, + EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_1SP, + "Lambert_Conformal_Conic_1SP", "lcc", nullptr, + []() { + static const ParamMapping paramLatLCC1SP = { + EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + WKT1_LATITUDE_OF_ORIGIN, common::UnitOfMeasure::Type::ANGULAR, + lat_1}; + + static const ParamMapping *const x[] = { + ¶mLatLCC1SP, ¶mLongitudeNatOrigin, ¶mScaleFactor, + ¶mFalseEasting, ¶mFalseNorthing, nullptr, + }; + return x; + }()}, + + {EPSG_NAME_METHOD_LAMBERT_CONIC_CONFORMAL_2SP, + EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_2SP, + "Lambert_Conformal_Conic_2SP", "lcc", nullptr, paramsLCC2SP}, + + {EPSG_NAME_METHOD_LAMBERT_CONIC_CONFORMAL_2SP_MICHIGAN, + EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_2SP_MICHIGAN, + nullptr, // no mapping to WKT1_GDAL + "lcc", nullptr, paramsLCC2SPMichigan}, + + {EPSG_NAME_METHOD_LAMBERT_CONIC_CONFORMAL_2SP_BELGIUM, + EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_2SP_BELGIUM, + "Lambert_Conformal_Conic_2SP_Belgium", "lcc", + nullptr, // FIXME: this is what is done in GDAL, but the formula of + // LCC 2SP + // Belgium in the EPSG 7.2 guidance is difference from the regular + // LCC 2SP + paramsLCC2SP}, + + {EPSG_NAME_METHOD_MODIFIED_AZIMUTHAL_EQUIDISTANT, + EPSG_CODE_METHOD_MODIFIED_AZIMUTHAL_EQUIDISTANT, "Azimuthal_Equidistant", + "aeqd", nullptr, paramsAEQD}, + + {EPSG_NAME_METHOD_GUAM_PROJECTION, EPSG_CODE_METHOD_GUAM_PROJECTION, + nullptr, // no mapping to GDAL WKT1 + "aeqd", "guam", paramsNatOrigin}, + + {EPSG_NAME_METHOD_BONNE, EPSG_CODE_METHOD_BONNE, "Bonne", "bonne", nullptr, + paramsBonne}, + + {EPSG_NAME_METHOD_LAMBERT_CYLINDRICAL_EQUAL_AREA_SPHERICAL, + EPSG_CODE_METHOD_LAMBERT_CYLINDRICAL_EQUAL_AREA_SPHERICAL, + "Cylindrical_Equal_Area", "cea", nullptr, paramsCEA}, + + {EPSG_NAME_METHOD_LAMBERT_CYLINDRICAL_EQUAL_AREA, + EPSG_CODE_METHOD_LAMBERT_CYLINDRICAL_EQUAL_AREA, "Cylindrical_Equal_Area", + "cea", nullptr, paramsCEA}, + + {EPSG_NAME_METHOD_CASSINI_SOLDNER, EPSG_CODE_METHOD_CASSINI_SOLDNER, + "Cassini_Soldner", "cass", nullptr, paramsNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_EQUIDISTANT_CONIC, 0, "Equidistant_Conic", "eqdc", + nullptr, paramsEQDC}, + + {PROJ_WKT2_NAME_METHOD_ECKERT_I, 0, "Eckert_I", "eck1", nullptr, + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_ECKERT_II, 0, "Eckert_II", "eck2", nullptr, + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_ECKERT_III, 0, "Eckert_III", "eck3", nullptr, + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_ECKERT_IV, 0, "Eckert_IV", "eck4", nullptr, + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_ECKERT_V, 0, "Eckert_V", "eck5", nullptr, + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_ECKERT_VI, 0, "Eckert_VI", "eck6", nullptr, + paramsLonNatOrigin}, + + {EPSG_NAME_METHOD_EQUIDISTANT_CYLINDRICAL, + EPSG_CODE_METHOD_EQUIDISTANT_CYLINDRICAL, "Equirectangular", "eqc", + nullptr, paramsEqc}, + + {EPSG_NAME_METHOD_EQUIDISTANT_CYLINDRICAL_SPHERICAL, + EPSG_CODE_METHOD_EQUIDISTANT_CYLINDRICAL_SPHERICAL, "Equirectangular", + "eqc", nullptr, paramsEqc}, + + {PROJ_WKT2_NAME_METHOD_GALL_STEREOGRAPHIC, 0, "Gall_Stereographic", "gall", + nullptr, paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_GOODE_HOMOLOSINE, 0, "Goode_Homolosine", "goode", + nullptr, paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_INTERRUPTED_GOODE_HOMOLOSINE, 0, + "Interrupted_Goode_Homolosine", "igh", nullptr, paramsLonNatOrigin}, + + // No WKT1 representation fr sweep=x + {PROJ_WKT2_NAME_METHOD_GEOSTATIONARY_SATELLITE_SWEEP_X, 0, nullptr, "geos", + "sweep=x", paramsGeos}, + + {PROJ_WKT2_NAME_METHOD_GEOSTATIONARY_SATELLITE_SWEEP_Y, 0, + "Geostationary_Satellite", "geos", nullptr, paramsGeos}, + + {PROJ_WKT2_NAME_METHOD_GAUSS_SCHREIBER_TRANSVERSE_MERCATOR, 0, + "Gauss_Schreiber_Transverse_Mercator", "gstmerc", nullptr, + paramsNatOriginScale}, + + {PROJ_WKT2_NAME_METHOD_GNOMONIC, 0, "Gnomonic", "gnom", nullptr, + paramsNatOrigin}, + + {EPSG_NAME_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_A, + EPSG_CODE_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_A, + "Hotine_Oblique_Mercator", "omerc", "no_uoff", paramsHomVariantA}, + + {EPSG_NAME_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_B, + EPSG_CODE_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_B, + "Hotine_Oblique_Mercator_Azimuth_Center", "omerc", nullptr, + paramsHomVariantB}, + + {PROJ_WKT2_NAME_METHOD_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN, 0, + "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "omerc", nullptr, + paramsHomTwoPoint}, + + {PROJ_WKT2_NAME_INTERNATIONAL_MAP_WORLD_POLYCONIC, 0, + "International_Map_of_the_World_Polyconic", "imw_p", nullptr, paramsIMWP}, + + {EPSG_NAME_METHOD_KROVAK_NORTH_ORIENTED, + EPSG_CODE_METHOD_KROVAK_NORTH_ORIENTED, "Krovak", "krovak", nullptr, + krovakParameters}, + + {EPSG_NAME_METHOD_KROVAK, EPSG_CODE_METHOD_KROVAK, "Krovak", "krovak", + "axis=swu", krovakParameters}, + + {EPSG_NAME_METHOD_LAMBERT_AZIMUTHAL_EQUAL_AREA, + EPSG_CODE_METHOD_LAMBERT_AZIMUTHAL_EQUAL_AREA, + "Lambert_Azimuthal_Equal_Area", "laea", nullptr, paramsLaea}, + + {EPSG_NAME_METHOD_LAMBERT_AZIMUTHAL_EQUAL_AREA_SPHERICAL, + EPSG_CODE_METHOD_LAMBERT_AZIMUTHAL_EQUAL_AREA_SPHERICAL, + "Lambert_Azimuthal_Equal_Area", "laea", nullptr, paramsLaea}, + + {PROJ_WKT2_NAME_METHOD_MILLER_CYLINDRICAL, 0, "Miller_Cylindrical", "mill", + "R_A", paramsMiller}, + + {EPSG_NAME_METHOD_MERCATOR_VARIANT_A, EPSG_CODE_METHOD_MERCATOR_VARIANT_A, + "Mercator_1SP", "merc", nullptr, paramsMerc1SP}, + + {EPSG_NAME_METHOD_MERCATOR_VARIANT_B, EPSG_CODE_METHOD_MERCATOR_VARIANT_B, + "Mercator_2SP", "merc", nullptr, paramsMerc2SP}, + + {EPSG_NAME_METHOD_POPULAR_VISUALISATION_PSEUDO_MERCATOR, + EPSG_CODE_METHOD_POPULAR_VISUALISATION_PSEUDO_MERCATOR, + "Popular_Visualisation_Pseudo_Mercator", // particular case actually + // handled manually + "webmerc", nullptr, paramsNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_MOLLWEIDE, 0, "Mollweide", "moll", nullptr, + paramsLonNatOrigin}, + + {EPSG_NAME_METHOD_NZMG, EPSG_CODE_METHOD_NZMG, "New_Zealand_Map_Grid", + "nzmg", nullptr, paramsNatOrigin}, + + { + EPSG_NAME_METHOD_OBLIQUE_STEREOGRAPHIC, + EPSG_CODE_METHOD_OBLIQUE_STEREOGRAPHIC, "Oblique_Stereographic", + "sterea", nullptr, paramsObliqueStereo, + }, + + {EPSG_NAME_METHOD_ORTHOGRAPHIC, EPSG_CODE_METHOD_ORTHOGRAPHIC, + "Orthographic", "ortho", nullptr, paramsNatOrigin}, + + {EPSG_NAME_METHOD_AMERICAN_POLYCONIC, EPSG_CODE_METHOD_AMERICAN_POLYCONIC, + "Polyconic", "poly", nullptr, paramsNatOrigin}, + + {EPSG_NAME_METHOD_POLAR_STEREOGRAPHIC_VARIANT_A, + EPSG_CODE_METHOD_POLAR_STEREOGRAPHIC_VARIANT_A, "Polar_Stereographic", + "stere", nullptr, paramsObliqueStereo}, + + {EPSG_NAME_METHOD_POLAR_STEREOGRAPHIC_VARIANT_B, + EPSG_CODE_METHOD_POLAR_STEREOGRAPHIC_VARIANT_B, "Polar_Stereographic", + "stere", nullptr, paramsPolarStereo}, + + {PROJ_WKT2_NAME_METHOD_ROBINSON, 0, "Robinson", "robin", nullptr, + paramsLonNatOriginLongitudeCentre}, + + {PROJ_WKT2_NAME_METHOD_SINUSOIDAL, 0, "Sinusoidal", "sinu", nullptr, + paramsLonNatOriginLongitudeCentre}, + + {PROJ_WKT2_NAME_METHOD_STEREOGRAPHIC, 0, "Stereographic", "stere", nullptr, + paramsObliqueStereo}, + + {PROJ_WKT2_NAME_METHOD_VAN_DER_GRINTEN, 0, "VanDerGrinten", "vandg", "R_A", + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_WAGNER_I, 0, "Wagner_I", "wag1", nullptr, + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_WAGNER_II, 0, "Wagner_II", "wag2", nullptr, + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_WAGNER_III, 0, "Wagner_III", "wag3", nullptr, + paramsWag3}, + + {PROJ_WKT2_NAME_METHOD_WAGNER_IV, 0, "Wagner_IV", "wag4", nullptr, + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_WAGNER_V, 0, "Wagner_V", "wag5", nullptr, + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_WAGNER_VI, 0, "Wagner_VI", "wag6", nullptr, + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_WAGNER_VII, 0, "Wagner_VII", "wag7", nullptr, + paramsLonNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_QUADRILATERALIZED_SPHERICAL_CUBE, 0, + "Quadrilateralized_Spherical_Cube", "qsc", nullptr, paramsNatOrigin}, + + {PROJ_WKT2_NAME_METHOD_SPHERICAL_CROSS_TRACK_HEIGHT, 0, + "Spherical_Cross_Track_Height", "sch", nullptr, paramsSch}, + + // The following methods have just the WKT <--> PROJ string mapping, but + // no setter. Similarly to GDAL + + {"Aitoff", 0, "Aitoff", "aitoff", nullptr, paramsLonNatOrigin}, + + {"Winkel I", 0, "Winkel_I", "wink1", nullptr, paramsWink1}, + + {"Winkel II", 0, "Winkel_II", "wink2", nullptr, paramsWink2}, + + {"Winkel Tripel", 0, "Winkel_Tripel", "wintri", nullptr, paramsWink2}, + + {"Craster Parabolic", 0, "Craster_Parabolic", "crast", nullptr, + paramsLonNatOrigin}, + + {"Loximuthal", 0, "Loximuthal", "loxim", nullptr, paramsLoxim}, + + {"Quartic Authalic", 0, "Quartic_Authalic", "qua_aut", nullptr, + paramsLonNatOrigin}, + + {EPSG_NAME_METHOD_EQUAL_EARTH, EPSG_CODE_METHOD_EQUAL_EARTH, nullptr, + "eqearth", nullptr, paramsLonNatOrigin}, + + {EPSG_NAME_METHOD_LABORDE_OBLIQUE_MERCATOR, + EPSG_CODE_METHOD_LABORDE_OBLIQUE_MERCATOR, nullptr, "labrd", nullptr, + paramsLabordeObliqueMercator}, + +}; + +#define METHOD_NAME_CODE(method) \ + { EPSG_NAME_METHOD_##method, EPSG_CODE_METHOD_##method } + +static const struct MethodNameCode { + const char *name; + int epsg_code; +} methodNameCodes[] = { + // Projection methods + METHOD_NAME_CODE(TRANSVERSE_MERCATOR), + METHOD_NAME_CODE(TRANSVERSE_MERCATOR_SOUTH_ORIENTATED), + METHOD_NAME_CODE(LAMBERT_CONIC_CONFORMAL_1SP), METHOD_NAME_CODE(NZMG), + METHOD_NAME_CODE(TUNISIA_MAPPING_GRID), METHOD_NAME_CODE(ALBERS_EQUAL_AREA), + METHOD_NAME_CODE(LAMBERT_CONIC_CONFORMAL_2SP), + METHOD_NAME_CODE(LAMBERT_CONIC_CONFORMAL_2SP_BELGIUM), + METHOD_NAME_CODE(LAMBERT_CONIC_CONFORMAL_2SP_MICHIGAN), + METHOD_NAME_CODE(MODIFIED_AZIMUTHAL_EQUIDISTANT), + METHOD_NAME_CODE(GUAM_PROJECTION), METHOD_NAME_CODE(BONNE), + METHOD_NAME_CODE(LAMBERT_CYLINDRICAL_EQUAL_AREA_SPHERICAL), + METHOD_NAME_CODE(LAMBERT_CYLINDRICAL_EQUAL_AREA), + METHOD_NAME_CODE(CASSINI_SOLDNER), + METHOD_NAME_CODE(EQUIDISTANT_CYLINDRICAL), + METHOD_NAME_CODE(EQUIDISTANT_CYLINDRICAL_SPHERICAL), + METHOD_NAME_CODE(HOTINE_OBLIQUE_MERCATOR_VARIANT_A), + METHOD_NAME_CODE(HOTINE_OBLIQUE_MERCATOR_VARIANT_B), + METHOD_NAME_CODE(KROVAK_NORTH_ORIENTED), METHOD_NAME_CODE(KROVAK), + METHOD_NAME_CODE(LAMBERT_AZIMUTHAL_EQUAL_AREA), + METHOD_NAME_CODE(POPULAR_VISUALISATION_PSEUDO_MERCATOR), + METHOD_NAME_CODE(MERCATOR_VARIANT_A), METHOD_NAME_CODE(MERCATOR_VARIANT_B), + METHOD_NAME_CODE(OBLIQUE_STEREOGRAPHIC), + METHOD_NAME_CODE(AMERICAN_POLYCONIC), + METHOD_NAME_CODE(POLAR_STEREOGRAPHIC_VARIANT_A), + METHOD_NAME_CODE(POLAR_STEREOGRAPHIC_VARIANT_B), + METHOD_NAME_CODE(EQUAL_EARTH), METHOD_NAME_CODE(LABORDE_OBLIQUE_MERCATOR), + // Other conversions + METHOD_NAME_CODE(CHANGE_VERTICAL_UNIT), + METHOD_NAME_CODE(AXIS_ORDER_REVERSAL_2D), + METHOD_NAME_CODE(AXIS_ORDER_REVERSAL_3D), + METHOD_NAME_CODE(GEOGRAPHIC_GEOCENTRIC), + // Transformations + METHOD_NAME_CODE(LONGITUDE_ROTATION), + METHOD_NAME_CODE(AFFINE_PARAMETRIC_TRANSFORMATION), + METHOD_NAME_CODE(COORDINATE_FRAME_GEOCENTRIC), + METHOD_NAME_CODE(COORDINATE_FRAME_GEOGRAPHIC_2D), + METHOD_NAME_CODE(COORDINATE_FRAME_GEOGRAPHIC_3D), + METHOD_NAME_CODE(POSITION_VECTOR_GEOCENTRIC), + METHOD_NAME_CODE(POSITION_VECTOR_GEOGRAPHIC_2D), + METHOD_NAME_CODE(POSITION_VECTOR_GEOGRAPHIC_3D), + METHOD_NAME_CODE(GEOCENTRIC_TRANSLATION_GEOCENTRIC), + METHOD_NAME_CODE(GEOCENTRIC_TRANSLATION_GEOGRAPHIC_2D), + METHOD_NAME_CODE(GEOCENTRIC_TRANSLATION_GEOGRAPHIC_3D), + METHOD_NAME_CODE(TIME_DEPENDENT_COORDINATE_FRAME_GEOCENTRIC), + METHOD_NAME_CODE(TIME_DEPENDENT_COORDINATE_FRAME_GEOGRAPHIC_2D), + METHOD_NAME_CODE(TIME_DEPENDENT_COORDINATE_FRAME_GEOGRAPHIC_3D), + METHOD_NAME_CODE(TIME_DEPENDENT_POSITION_VECTOR_GEOCENTRIC), + METHOD_NAME_CODE(TIME_DEPENDENT_POSITION_VECTOR_GEOGRAPHIC_2D), + METHOD_NAME_CODE(TIME_DEPENDENT_POSITION_VECTOR_GEOGRAPHIC_3D), + METHOD_NAME_CODE(MOLODENSKY_BADEKAS_CF_GEOCENTRIC), + METHOD_NAME_CODE(MOLODENSKY_BADEKAS_CF_GEOGRAPHIC_2D), + METHOD_NAME_CODE(MOLODENSKY_BADEKAS_CF_GEOGRAPHIC_3D), + METHOD_NAME_CODE(MOLODENSKY_BADEKAS_PV_GEOCENTRIC), + METHOD_NAME_CODE(MOLODENSKY_BADEKAS_PV_GEOGRAPHIC_2D), + METHOD_NAME_CODE(MOLODENSKY_BADEKAS_PV_GEOGRAPHIC_3D), + METHOD_NAME_CODE(MOLODENSKY), METHOD_NAME_CODE(ABRIDGED_MOLODENSKY), + METHOD_NAME_CODE(GEOGRAPHIC2D_OFFSETS), + METHOD_NAME_CODE(GEOGRAPHIC2D_WITH_HEIGHT_OFFSETS), + METHOD_NAME_CODE(GEOGRAPHIC3D_OFFSETS), METHOD_NAME_CODE(VERTICAL_OFFSET), + METHOD_NAME_CODE(NTV2), METHOD_NAME_CODE(NTV1), METHOD_NAME_CODE(NADCON), + METHOD_NAME_CODE(VERTCON), +}; + +#define PARAM_NAME_CODE(method) \ + { EPSG_NAME_PARAMETER_##method, EPSG_CODE_PARAMETER_##method } + +static const struct ParamNameCode { + const char *name; + int epsg_code; +} paramNameCodes[] = { + // Parameters of projection methods + PARAM_NAME_CODE(COLATITUDE_CONE_AXIS), + PARAM_NAME_CODE(LATITUDE_OF_NATURAL_ORIGIN), + PARAM_NAME_CODE(LONGITUDE_OF_NATURAL_ORIGIN), + PARAM_NAME_CODE(SCALE_FACTOR_AT_NATURAL_ORIGIN), + PARAM_NAME_CODE(FALSE_EASTING), PARAM_NAME_CODE(FALSE_NORTHING), + PARAM_NAME_CODE(LATITUDE_PROJECTION_CENTRE), + PARAM_NAME_CODE(LONGITUDE_PROJECTION_CENTRE), + PARAM_NAME_CODE(AZIMUTH_INITIAL_LINE), + PARAM_NAME_CODE(ANGLE_RECTIFIED_TO_SKEW_GRID), + PARAM_NAME_CODE(SCALE_FACTOR_INITIAL_LINE), + PARAM_NAME_CODE(EASTING_PROJECTION_CENTRE), + PARAM_NAME_CODE(NORTHING_PROJECTION_CENTRE), + PARAM_NAME_CODE(LATITUDE_PSEUDO_STANDARD_PARALLEL), + PARAM_NAME_CODE(SCALE_FACTOR_PSEUDO_STANDARD_PARALLEL), + PARAM_NAME_CODE(LATITUDE_FALSE_ORIGIN), + PARAM_NAME_CODE(LONGITUDE_FALSE_ORIGIN), + PARAM_NAME_CODE(LATITUDE_1ST_STD_PARALLEL), + PARAM_NAME_CODE(LATITUDE_2ND_STD_PARALLEL), + PARAM_NAME_CODE(EASTING_FALSE_ORIGIN), + PARAM_NAME_CODE(NORTHING_FALSE_ORIGIN), + PARAM_NAME_CODE(LATITUDE_STD_PARALLEL), + PARAM_NAME_CODE(LONGITUDE_OF_ORIGIN), + PARAM_NAME_CODE(ELLIPSOID_SCALE_FACTOR), + // Parameters of transformations + PARAM_NAME_CODE(SEMI_MAJOR_AXIS_DIFFERENCE), + PARAM_NAME_CODE(FLATTENING_DIFFERENCE), + PARAM_NAME_CODE(LATITUDE_LONGITUDE_DIFFERENCE_FILE), + PARAM_NAME_CODE(GEOID_CORRECTION_FILENAME), + PARAM_NAME_CODE(VERTICAL_OFFSET_FILE), + PARAM_NAME_CODE(LATITUDE_DIFFERENCE_FILE), + PARAM_NAME_CODE(LONGITUDE_DIFFERENCE_FILE), + PARAM_NAME_CODE(UNIT_CONVERSION_SCALAR), PARAM_NAME_CODE(LATITUDE_OFFSET), + PARAM_NAME_CODE(LONGITUDE_OFFSET), PARAM_NAME_CODE(VERTICAL_OFFSET), + PARAM_NAME_CODE(GEOID_UNDULATION), PARAM_NAME_CODE(A0), PARAM_NAME_CODE(A1), + PARAM_NAME_CODE(A2), PARAM_NAME_CODE(B0), PARAM_NAME_CODE(B1), + PARAM_NAME_CODE(B2), PARAM_NAME_CODE(X_AXIS_TRANSLATION), + PARAM_NAME_CODE(Y_AXIS_TRANSLATION), PARAM_NAME_CODE(Z_AXIS_TRANSLATION), + PARAM_NAME_CODE(X_AXIS_ROTATION), PARAM_NAME_CODE(Y_AXIS_ROTATION), + PARAM_NAME_CODE(Z_AXIS_ROTATION), PARAM_NAME_CODE(SCALE_DIFFERENCE), + PARAM_NAME_CODE(RATE_X_AXIS_TRANSLATION), + PARAM_NAME_CODE(RATE_Y_AXIS_TRANSLATION), + PARAM_NAME_CODE(RATE_Z_AXIS_TRANSLATION), + PARAM_NAME_CODE(RATE_X_AXIS_ROTATION), + PARAM_NAME_CODE(RATE_Y_AXIS_ROTATION), + PARAM_NAME_CODE(RATE_Z_AXIS_ROTATION), + PARAM_NAME_CODE(RATE_SCALE_DIFFERENCE), PARAM_NAME_CODE(REFERENCE_EPOCH), + PARAM_NAME_CODE(TRANSFORMATION_REFERENCE_EPOCH), + PARAM_NAME_CODE(ORDINATE_1_EVAL_POINT), + PARAM_NAME_CODE(ORDINATE_2_EVAL_POINT), + PARAM_NAME_CODE(ORDINATE_3_EVAL_POINT), +}; + +// end of anonymous namespace +} + +// --------------------------------------------------------------------------- + +//! @endcond + +#endif // COORDINATEOPERATION_CONSTANTS_HH_INCLUDED diff --git a/include/proj/internal/coordinateoperation_internal.hpp b/include/proj/internal/coordinateoperation_internal.hpp new file mode 100644 index 00000000..83e1e987 --- /dev/null +++ b/include/proj/internal/coordinateoperation_internal.hpp @@ -0,0 +1,274 @@ +/****************************************************************************** + * + * Project: PROJ + * Purpose: ISO19111:2018 implementation + * Author: Even Rouault <even dot rouault at spatialys dot com> + * + ****************************************************************************** + * Copyright (c) 2018, Even Rouault <even dot rouault at spatialys dot com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ****************************************************************************/ + +#ifndef FROM_PROJ_CPP +#error This file should only be included from a PROJ cpp file +#endif + +#ifndef COORDINATEOPERATION_INTERNAL_HH_INCLUDED +#define COORDINATEOPERATION_INTERNAL_HH_INCLUDED + +#include "proj/coordinateoperation.hpp" + +#include <vector> + +//! @cond Doxygen_Suppress + +NS_PROJ_START + +namespace operation { + +struct ParamMapping { + const char *wkt2_name; + const int epsg_code; + const char *wkt1_name; + const common::UnitOfMeasure::Type unit_type; + const char *proj_name; +}; + +struct MethodMapping { + const char *wkt2_name; + const int epsg_code; + const char *wkt1_name; + const char *proj_name_main; + const char *proj_name_aux; + const ParamMapping *const *params; +}; + +const MethodMapping *getMapping(int epsg_code) noexcept; +const MethodMapping *getMappingFromWKT1(const std::string &wkt1_name) noexcept; +const MethodMapping *getMapping(const char *wkt2_name) noexcept; +const MethodMapping *getMapping(const OperationMethod *method) noexcept; +std::vector<const MethodMapping *> +getMappingsFromPROJName(const std::string &projName); +const ParamMapping *getMapping(const MethodMapping *mapping, + const OperationParameterValue *param); +const ParamMapping *getMappingFromWKT1(const MethodMapping *mapping, + const std::string &wkt1_name); +// --------------------------------------------------------------------------- + +struct ESRIParamMapping { + const char *esri_name; + const char *wkt2_name; + int epsg_code; + float fixed_value; +}; + +struct ESRIMethodMapping { + const char *esri_name; + const char *wkt2_name; + int epsg_code; + const ESRIParamMapping *const params; +}; + +std::vector<const ESRIMethodMapping *> +getMappingsFromESRI(const std::string &esri_name); + +// --------------------------------------------------------------------------- + +bool isAxisOrderReversal(int methodEPSGCode); + +// --------------------------------------------------------------------------- + +class InverseCoordinateOperation; +/** Shared pointer of InverseCoordinateOperation */ +using InverseCoordinateOperationPtr = + std::shared_ptr<InverseCoordinateOperation>; +/** Non-null shared pointer of InverseCoordinateOperation */ +using InverseCoordinateOperationNNPtr = util::nn<InverseCoordinateOperationPtr>; + +/** \brief Inverse operation of a CoordinateOperation. + * + * This is used when there is no straightforward way of building another + * subclass of CoordinateOperation that models the inverse operation. + */ +class InverseCoordinateOperation : virtual public CoordinateOperation { + public: + InverseCoordinateOperation(const CoordinateOperationNNPtr &forwardOperation, + bool wktSupportsInversion); + + ~InverseCoordinateOperation() override; + + void _exportToPROJString(io::PROJStringFormatter *formatter) + const override; // throw(FormattingException) + + bool + _isEquivalentTo(const util::IComparable *other, + util::IComparable::Criterion criterion = + util::IComparable::Criterion::STRICT) const override; + + CoordinateOperationNNPtr inverse() const override; + + protected: + CoordinateOperationNNPtr forwardOperation_; + bool wktSupportsInversion_; + + void setPropertiesFromForward(); +}; + +// --------------------------------------------------------------------------- + +/** \brief Inverse of a conversion. */ +class InverseConversion : public Conversion, public InverseCoordinateOperation { + public: + explicit InverseConversion(const ConversionNNPtr &forward); + + ~InverseConversion() override; + + void _exportToWKT(io::WKTFormatter *formatter) const override { + Conversion::_exportToWKT(formatter); + } + + void + _exportToPROJString(io::PROJStringFormatter *formatter) const override { + InverseCoordinateOperation::_exportToPROJString(formatter); + } + + bool + _isEquivalentTo(const util::IComparable *other, + util::IComparable::Criterion criterion = + util::IComparable::Criterion::STRICT) const override { + return InverseCoordinateOperation::_isEquivalentTo(other, criterion); + } + + CoordinateOperationNNPtr inverse() const override { + return InverseCoordinateOperation::inverse(); + } + + ConversionNNPtr inverseAsConversion() const; + +#ifdef _MSC_VER + // To avoid a warning C4250: 'osgeo::proj::operation::InverseConversion': + // inherits + // 'osgeo::proj::operation::SingleOperation::osgeo::proj::operation::SingleOperation::gridsNeeded' + // via dominance + std::set<GridDescription> + gridsNeeded(const io::DatabaseContextPtr &databaseContext) const override { + return SingleOperation::gridsNeeded(databaseContext); + } +#endif + + static CoordinateOperationNNPtr create(const ConversionNNPtr &forward); +}; + +// --------------------------------------------------------------------------- + +/** \brief Inverse of a transformation. */ +class InverseTransformation : public Transformation, + public InverseCoordinateOperation { + public: + explicit InverseTransformation(const TransformationNNPtr &forward); + + ~InverseTransformation() override; + + void _exportToWKT(io::WKTFormatter *formatter) const override; + + void + _exportToPROJString(io::PROJStringFormatter *formatter) const override { + return InverseCoordinateOperation::_exportToPROJString(formatter); + } + + bool + _isEquivalentTo(const util::IComparable *other, + util::IComparable::Criterion criterion = + util::IComparable::Criterion::STRICT) const override { + return InverseCoordinateOperation::_isEquivalentTo(other, criterion); + } + + CoordinateOperationNNPtr inverse() const override { + return InverseCoordinateOperation::inverse(); + } + +#ifdef _MSC_VER + // To avoid a warning C4250: + // 'osgeo::proj::operation::InverseTransformation': inherits + // 'osgeo::proj::operation::SingleOperation::osgeo::proj::operation::SingleOperation::gridsNeeded' + // via dominance + std::set<GridDescription> + gridsNeeded(const io::DatabaseContextPtr &databaseContext) const override { + return SingleOperation::gridsNeeded(databaseContext); + } +#endif + + static TransformationNNPtr create(const TransformationNNPtr &forward); +}; + +// --------------------------------------------------------------------------- + +class PROJBasedOperation; +/** Shared pointer of PROJBasedOperation */ +using PROJBasedOperationPtr = std::shared_ptr<PROJBasedOperation>; +/** Non-null shared pointer of PROJBasedOperation */ +using PROJBasedOperationNNPtr = util::nn<PROJBasedOperationPtr>; + +/** \brief A PROJ-string based coordinate operation. + */ +class PROJBasedOperation : public SingleOperation { + public: + ~PROJBasedOperation() override; + + void _exportToWKT(io::WKTFormatter *formatter) + const override; // throw(io::FormattingException) + + CoordinateOperationNNPtr inverse() const override; + + static PROJBasedOperationNNPtr + create(const util::PropertyMap &properties, const std::string &PROJString, + const crs::CRSPtr &sourceCRS, const crs::CRSPtr &targetCRS, + const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies); + + static PROJBasedOperationNNPtr + create(const util::PropertyMap &properties, + const io::IPROJStringExportableNNPtr &projExportable, bool inverse, + const crs::CRSNNPtr &sourceCRS, const crs::CRSNNPtr &targetCRS, + const std::vector<metadata::PositionalAccuracyNNPtr> &accuracies); + + std::set<GridDescription> + gridsNeeded(const io::DatabaseContextPtr &databaseContext) const override; + + protected: + PROJBasedOperation(const OperationMethodNNPtr &methodIn, + const std::vector<GeneralParameterValueNNPtr> &values); + + void _exportToPROJString(io::PROJStringFormatter *formatter) + const override; // throw(FormattingException) + + INLINED_MAKE_SHARED + + private: + io::IPROJStringExportablePtr projStringExportable_{}; + bool inverse_ = false; +}; + +} // namespace operation + +NS_PROJ_END + +//! @endcond + +#endif // COORDINATEOPERATION_INTERNAL_HH_INCLUDED diff --git a/include/proj/internal/coordinatesystem_internal.hpp b/include/proj/internal/coordinatesystem_internal.hpp new file mode 100644 index 00000000..63c5f7af --- /dev/null +++ b/include/proj/internal/coordinatesystem_internal.hpp @@ -0,0 +1,104 @@ +/****************************************************************************** + * + * Project: PROJ + * Purpose: ISO19111:2018 implementation + * Author: Even Rouault <even dot rouault at spatialys dot com> + * + ****************************************************************************** + * Copyright (c) 2018, Even Rouault <even dot rouault at spatialys dot com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ****************************************************************************/ + +#ifndef FROM_PROJ_CPP +#error This file should only be included from a PROJ cpp file +#endif + +#ifndef COORDINATESYSTEM_INTERNAL_HH_INCLUDED +#define COORDINATESYSTEM_INTERNAL_HH_INCLUDED + +#include "proj/util.hpp" + +#include <map> +#include <set> +#include <string> + +//! @cond Doxygen_Suppress + +NS_PROJ_START + +namespace cs { + +// --------------------------------------------------------------------------- + +class AxisDirectionWKT1 : public util::CodeList { + public: + static const AxisDirectionWKT1 *valueOf(const std::string &nameIn); + + static const AxisDirectionWKT1 NORTH; + static const AxisDirectionWKT1 SOUTH; + static const AxisDirectionWKT1 EAST; + static const AxisDirectionWKT1 WEST; + static const AxisDirectionWKT1 UP; + static const AxisDirectionWKT1 DOWN; + static const AxisDirectionWKT1 OTHER; + + private: + explicit AxisDirectionWKT1(const std::string &nameIn); + + static std::map<std::string, const AxisDirectionWKT1 *> registry; +}; + +// --------------------------------------------------------------------------- + +class AxisName { + public: + static const std::string Longitude; + static const std::string Latitude; + static const std::string Easting; + static const std::string Northing; + static const std::string Westing; + static const std::string Southing; + static const std::string Ellipsoidal_height; + static const std::string Geocentric_X; + static const std::string Geocentric_Y; + static const std::string Geocentric_Z; +}; + +// --------------------------------------------------------------------------- + +class AxisAbbreviation { + public: + static const std::string lon; + static const std::string lat; + static const std::string E; + static const std::string N; + static const std::string h; + static const std::string X; + static const std::string Y; + static const std::string Z; +}; + +} // namespace cs + +NS_PROJ_END + +//! @endcond + +#endif // COORDINATESYSTEM_INTERNAL_HH_INCLUDED diff --git a/include/proj/internal/esri_projection_mappings.hpp b/include/proj/internal/esri_projection_mappings.hpp new file mode 100644 index 00000000..4ceeb300 --- /dev/null +++ b/include/proj/internal/esri_projection_mappings.hpp @@ -0,0 +1,887 @@ +// This file was generated by scripts/build_esri_projection_mapping.py. DO NOT +// EDIT ! + +#ifndef FROM_COORDINATE_OPERATION_CPP +#error This file should only be included from coordinateoperation.cpp +#endif + +#ifndef ESRI_PROJECTION_MAPPINGS_HH_INCLUDED +#define ESRI_PROJECTION_MAPPINGS_HH_INCLUDED + +#include "coordinateoperation_internal.hpp" + +//! @cond Doxygen_Suppress + +// --------------------------------------------------------------------------- + +// anonymous namespace +namespace { + +using namespace ::NS_PROJ; +using namespace ::NS_PROJ::operation; + +static const ESRIParamMapping paramsESRI_Plate_Carree[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Equidistant_Cylindrical[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Miller_Cylindrical[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Mercator[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Gauss_Kruger[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Transverse_Mercator[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Albers[] = { + {"False_Easting", EPSG_NAME_PARAMETER_EASTING_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_EASTING_FALSE_ORIGIN, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_NORTHING_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_NORTHING_FALSE_ORIGIN, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_FALSE_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {"Standard_Parallel_2", EPSG_NAME_PARAMETER_LATITUDE_2ND_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_2ND_STD_PARALLEL, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_FALSE_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Sinusoidal[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Mollweide[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Eckert_I[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Eckert_II[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Eckert_III[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Eckert_IV[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Eckert_V[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Eckert_VI[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Gall_Stereographic[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Winkel_I[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Winkel_II[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Lambert_Conformal_Conic_alt1[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; +static const ESRIParamMapping paramsESRI_Lambert_Conformal_Conic_alt2[] = { + {"False_Easting", EPSG_NAME_PARAMETER_EASTING_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_EASTING_FALSE_ORIGIN, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_NORTHING_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_NORTHING_FALSE_ORIGIN, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_FALSE_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {"Standard_Parallel_2", EPSG_NAME_PARAMETER_LATITUDE_2ND_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_2ND_STD_PARALLEL, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_FALSE_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; +static const ESRIParamMapping paramsESRI_Lambert_Conformal_Conic_alt3[] = { + {"False_Easting", EPSG_NAME_PARAMETER_EASTING_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_EASTING_FALSE_ORIGIN, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_NORTHING_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_NORTHING_FALSE_ORIGIN, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_FALSE_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {"Standard_Parallel_2", EPSG_NAME_PARAMETER_LATITUDE_2ND_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_2ND_STD_PARALLEL, 0.0}, + {"Scale_Factor", nullptr, 0, 1.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_FALSE_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; +static const ESRIParamMapping paramsESRI_Lambert_Conformal_Conic_alt4[] = { + {"False_Easting", EPSG_NAME_PARAMETER_EASTING_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_EASTING_FALSE_ORIGIN, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_NORTHING_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_NORTHING_FALSE_ORIGIN, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_FALSE_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {"Standard_Parallel_2", EPSG_NAME_PARAMETER_LATITUDE_2ND_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_2ND_STD_PARALLEL, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_ELLIPSOID_SCALE_FACTOR, + EPSG_CODE_PARAMETER_ELLIPSOID_SCALE_FACTOR, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_FALSE_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_FALSE_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Polyconic[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Quartic_Authalic[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Loximuthal[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Central_Parallel", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Bonne[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping + paramsESRI_Hotine_Oblique_Mercator_Two_Point_Natural_Origin[] = { + {"False_Easting", EPSG_NAME_PARAMETER_EASTING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_EASTING_PROJECTION_CENTRE, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_NORTHING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_NORTHING_PROJECTION_CENTRE, 0.0}, + {"Latitude_Of_1st_Point", "Latitude of 1st point", 0, 0.0}, + {"Latitude_Of_2nd_Point", "Latitude of 2nd point", 0, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_INITIAL_LINE, + EPSG_CODE_PARAMETER_SCALE_FACTOR_INITIAL_LINE, 0.0}, + {"Longitude_Of_1st_Point", "Longitude of 1st point", 0, 0.0}, + {"Longitude_Of_2nd_Point", "Longitude of 2nd point", 0, 0.0}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LATITUDE_PROJECTION_CENTRE, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Stereographic[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Equidistant_Conic[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {"Standard_Parallel_2", EPSG_NAME_PARAMETER_LATITUDE_2ND_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_2ND_STD_PARALLEL, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Cassini[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Scale_Factor", nullptr, 0, 1.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Van_der_Grinten_I[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Robinson[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Two_Point_Equidistant[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Latitude_Of_1st_Point", "Latitude of 1st point", 0, 0.0}, + {"Latitude_Of_2nd_Point", "Latitude of 2nd point", 0, 0.0}, + {"Longitude_Of_1st_Point", "Longitude of 1st point", 0, 0.0}, + {"Longitude_Of_2nd_Point", "Longitude of 2nd point", 0, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Azimuthal_Equidistant[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Lambert_Azimuthal_Equal_Area[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Cylindrical_Equal_Area[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping + paramsESRI_Hotine_Oblique_Mercator_Two_Point_Center[] = { + {"False_Easting", EPSG_NAME_PARAMETER_EASTING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_EASTING_PROJECTION_CENTRE, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_NORTHING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_NORTHING_PROJECTION_CENTRE, 0.0}, + {"Latitude_Of_1st_Point", "Latitude of 1st point", 0, 0.0}, + {"Latitude_Of_2nd_Point", "Latitude of 2nd point", 0, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_INITIAL_LINE, + EPSG_CODE_PARAMETER_SCALE_FACTOR_INITIAL_LINE, 0.0}, + {"Longitude_Of_1st_Point", "Longitude of 1st point", 0, 0.0}, + {"Longitude_Of_2nd_Point", "Longitude of 2nd point", 0, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping + paramsESRI_Hotine_Oblique_Mercator_Azimuth_Natural_Origin[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_INITIAL_LINE, + EPSG_CODE_PARAMETER_SCALE_FACTOR_INITIAL_LINE, 0.0}, + {"Azimuth", EPSG_NAME_PARAMETER_AZIMUTH_INITIAL_LINE, + EPSG_CODE_PARAMETER_AZIMUTH_INITIAL_LINE, 0.0}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LONGITUDE_PROJECTION_CENTRE, 0.0}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LATITUDE_PROJECTION_CENTRE, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping + paramsESRI_Hotine_Oblique_Mercator_Azimuth_Center[] = { + {"False_Easting", EPSG_NAME_PARAMETER_EASTING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_EASTING_PROJECTION_CENTRE, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_NORTHING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_NORTHING_PROJECTION_CENTRE, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_INITIAL_LINE, + EPSG_CODE_PARAMETER_SCALE_FACTOR_INITIAL_LINE, 0.0}, + {"Azimuth", EPSG_NAME_PARAMETER_AZIMUTH_INITIAL_LINE, + EPSG_CODE_PARAMETER_AZIMUTH_INITIAL_LINE, 0.0}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LONGITUDE_PROJECTION_CENTRE, 0.0}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LATITUDE_PROJECTION_CENTRE, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Double_Stereographic[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_SCALE_FACTOR_AT_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Krovak_alt1[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Pseudo_Standard_Parallel_1", + EPSG_NAME_PARAMETER_LATITUDE_PSEUDO_STANDARD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_PSEUDO_STANDARD_PARALLEL, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_PSEUDO_STANDARD_PARALLEL, + EPSG_CODE_PARAMETER_SCALE_FACTOR_PSEUDO_STANDARD_PARALLEL, 0.0}, + {"Azimuth", EPSG_NAME_PARAMETER_COLATITUDE_CONE_AXIS, + EPSG_CODE_PARAMETER_COLATITUDE_CONE_AXIS, 0.0}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_OF_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_ORIGIN, 0.0}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LATITUDE_PROJECTION_CENTRE, 0.0}, + {"X_Scale", nullptr, 0, 1.0}, + {"Y_Scale", nullptr, 0, 1.0}, + {"XY_Plane_Rotation", nullptr, 0, 0.0}, + {nullptr, nullptr, 0, 0.0}}; +static const ESRIParamMapping paramsESRI_Krovak_alt2[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Pseudo_Standard_Parallel_1", + EPSG_NAME_PARAMETER_LATITUDE_PSEUDO_STANDARD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_PSEUDO_STANDARD_PARALLEL, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_PSEUDO_STANDARD_PARALLEL, + EPSG_CODE_PARAMETER_SCALE_FACTOR_PSEUDO_STANDARD_PARALLEL, 0.0}, + {"Azimuth", EPSG_NAME_PARAMETER_COLATITUDE_CONE_AXIS, + EPSG_CODE_PARAMETER_COLATITUDE_CONE_AXIS, 0.0}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_OF_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_ORIGIN, 0.0}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LATITUDE_PROJECTION_CENTRE, 0.0}, + {"X_Scale", nullptr, 0, -1.0}, + {"Y_Scale", nullptr, 0, 1.0}, + {"XY_Plane_Rotation", nullptr, 0, 90.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_New_Zealand_Map_Grid[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Longitude_Of_Origin", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Orthographic[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Winkel_Tripel[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Aitoff[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Craster_Parabolic[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Gnomonic[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Stereographic_North_Pole[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_STD_PARALLEL, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Stereographic_South_Pole[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_STD_PARALLEL, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping + paramsESRI_Rectified_Skew_Orthomorphic_Natural_Origin[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_INITIAL_LINE, + EPSG_CODE_PARAMETER_SCALE_FACTOR_INITIAL_LINE, 0.0}, + {"Azimuth", EPSG_NAME_PARAMETER_AZIMUTH_INITIAL_LINE, + EPSG_CODE_PARAMETER_AZIMUTH_INITIAL_LINE, 0.0}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LONGITUDE_PROJECTION_CENTRE, 0.0}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LATITUDE_PROJECTION_CENTRE, 0.0}, + {"XY_Plane_Rotation", EPSG_NAME_PARAMETER_ANGLE_RECTIFIED_TO_SKEW_GRID, + EPSG_CODE_PARAMETER_ANGLE_RECTIFIED_TO_SKEW_GRID, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Rectified_Skew_Orthomorphic_Center[] = + {{"False_Easting", EPSG_NAME_PARAMETER_EASTING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_EASTING_PROJECTION_CENTRE, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_NORTHING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_NORTHING_PROJECTION_CENTRE, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_INITIAL_LINE, + EPSG_CODE_PARAMETER_SCALE_FACTOR_INITIAL_LINE, 0.0}, + {"Azimuth", EPSG_NAME_PARAMETER_AZIMUTH_INITIAL_LINE, + EPSG_CODE_PARAMETER_AZIMUTH_INITIAL_LINE, 0.0}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LONGITUDE_PROJECTION_CENTRE, 0.0}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LATITUDE_PROJECTION_CENTRE, 0.0}, + {"XY_Plane_Rotation", EPSG_NAME_PARAMETER_ANGLE_RECTIFIED_TO_SKEW_GRID, + EPSG_CODE_PARAMETER_ANGLE_RECTIFIED_TO_SKEW_GRID, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Goode_Homolosine[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Equidistant_Cylindrical_Ellipsoidal[] = + {{"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL, + EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Laborde_Oblique_Mercator[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_INITIAL_LINE, + EPSG_CODE_PARAMETER_SCALE_FACTOR_INITIAL_LINE, 0.0}, + {"Azimuth", EPSG_NAME_PARAMETER_AZIMUTH_INITIAL_LINE, + EPSG_CODE_PARAMETER_AZIMUTH_INITIAL_LINE, 0.0}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LONGITUDE_PROJECTION_CENTRE, 0.0}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LATITUDE_PROJECTION_CENTRE, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Gnomonic_Ellipsoidal[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Wagner_IV[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Latitude_Of_Origin", nullptr, 0, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Wagner_V[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Wagner_VII[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Geostationary_Satellite[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Height", "Satellite Height", 0, 0.0}, + {"Option", nullptr, 0, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIParamMapping paramsESRI_Mercator_Auxiliary_Sphere[] = { + {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, + EPSG_CODE_PARAMETER_FALSE_EASTING, 0.0}, + {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, + EPSG_CODE_PARAMETER_FALSE_NORTHING, 0.0}, + {"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, + EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, 0.0}, + {"Auxiliary_Sphere_Type", nullptr, 0, 0.0}, + {nullptr, nullptr, 0, 0.0}}; + +static const ESRIMethodMapping esriMappings[] = { + {"Plate_Carree", EPSG_NAME_METHOD_EQUIDISTANT_CYLINDRICAL, + EPSG_CODE_METHOD_EQUIDISTANT_CYLINDRICAL, paramsESRI_Plate_Carree}, + {"Plate_Carree", EPSG_NAME_METHOD_EQUIDISTANT_CYLINDRICAL_SPHERICAL, + EPSG_CODE_METHOD_EQUIDISTANT_CYLINDRICAL_SPHERICAL, + paramsESRI_Plate_Carree}, + {"Equidistant_Cylindrical", EPSG_NAME_METHOD_EQUIDISTANT_CYLINDRICAL, + EPSG_CODE_METHOD_EQUIDISTANT_CYLINDRICAL, + paramsESRI_Equidistant_Cylindrical}, + {"Miller_Cylindrical", PROJ_WKT2_NAME_METHOD_MILLER_CYLINDRICAL, 0, + paramsESRI_Miller_Cylindrical}, + {"Mercator", EPSG_NAME_METHOD_MERCATOR_VARIANT_B, + EPSG_CODE_METHOD_MERCATOR_VARIANT_B, paramsESRI_Mercator}, + {"Gauss_Kruger", EPSG_NAME_METHOD_TRANSVERSE_MERCATOR, + EPSG_CODE_METHOD_TRANSVERSE_MERCATOR, paramsESRI_Gauss_Kruger}, + {"Transverse_Mercator", EPSG_NAME_METHOD_TRANSVERSE_MERCATOR, + EPSG_CODE_METHOD_TRANSVERSE_MERCATOR, paramsESRI_Transverse_Mercator}, + {"Albers", EPSG_NAME_METHOD_ALBERS_EQUAL_AREA, + EPSG_CODE_METHOD_ALBERS_EQUAL_AREA, paramsESRI_Albers}, + {"Sinusoidal", PROJ_WKT2_NAME_METHOD_SINUSOIDAL, 0, paramsESRI_Sinusoidal}, + {"Mollweide", PROJ_WKT2_NAME_METHOD_MOLLWEIDE, 0, paramsESRI_Mollweide}, + {"Eckert_I", PROJ_WKT2_NAME_METHOD_ECKERT_I, 0, paramsESRI_Eckert_I}, + {"Eckert_II", PROJ_WKT2_NAME_METHOD_ECKERT_II, 0, paramsESRI_Eckert_II}, + {"Eckert_III", PROJ_WKT2_NAME_METHOD_ECKERT_III, 0, paramsESRI_Eckert_III}, + {"Eckert_IV", PROJ_WKT2_NAME_METHOD_ECKERT_IV, 0, paramsESRI_Eckert_IV}, + {"Eckert_V", PROJ_WKT2_NAME_METHOD_ECKERT_V, 0, paramsESRI_Eckert_V}, + {"Eckert_VI", PROJ_WKT2_NAME_METHOD_ECKERT_VI, 0, paramsESRI_Eckert_VI}, + {"Gall_Stereographic", PROJ_WKT2_NAME_METHOD_GALL_STEREOGRAPHIC, 0, + paramsESRI_Gall_Stereographic}, + {"Winkel_I", "Winkel I", 0, paramsESRI_Winkel_I}, + {"Winkel_II", "Winkel II", 0, paramsESRI_Winkel_II}, + {"Lambert_Conformal_Conic", EPSG_NAME_METHOD_LAMBERT_CONIC_CONFORMAL_1SP, + EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_1SP, + paramsESRI_Lambert_Conformal_Conic_alt1}, + {"Lambert_Conformal_Conic", EPSG_NAME_METHOD_LAMBERT_CONIC_CONFORMAL_2SP, + EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_2SP, + paramsESRI_Lambert_Conformal_Conic_alt2}, + {"Lambert_Conformal_Conic", EPSG_NAME_METHOD_LAMBERT_CONIC_CONFORMAL_2SP, + EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_2SP, + paramsESRI_Lambert_Conformal_Conic_alt3}, + {"Lambert_Conformal_Conic", + EPSG_NAME_METHOD_LAMBERT_CONIC_CONFORMAL_2SP_MICHIGAN, + EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_2SP_MICHIGAN, + paramsESRI_Lambert_Conformal_Conic_alt4}, + {"Polyconic", EPSG_NAME_METHOD_AMERICAN_POLYCONIC, + EPSG_CODE_METHOD_AMERICAN_POLYCONIC, paramsESRI_Polyconic}, + {"Quartic_Authalic", "Quartic Authalic", 0, paramsESRI_Quartic_Authalic}, + {"Loximuthal", "Loximuthal", 0, paramsESRI_Loximuthal}, + {"Bonne", EPSG_NAME_METHOD_BONNE, EPSG_CODE_METHOD_BONNE, paramsESRI_Bonne}, + {"Hotine_Oblique_Mercator_Two_Point_Natural_Origin", + PROJ_WKT2_NAME_METHOD_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN, 0, + paramsESRI_Hotine_Oblique_Mercator_Two_Point_Natural_Origin}, + {"Stereographic", PROJ_WKT2_NAME_METHOD_STEREOGRAPHIC, 0, + paramsESRI_Stereographic}, + {"Equidistant_Conic", PROJ_WKT2_NAME_METHOD_EQUIDISTANT_CONIC, 0, + paramsESRI_Equidistant_Conic}, + {"Cassini", EPSG_NAME_METHOD_CASSINI_SOLDNER, + EPSG_CODE_METHOD_CASSINI_SOLDNER, paramsESRI_Cassini}, + {"Van_der_Grinten_I", PROJ_WKT2_NAME_METHOD_VAN_DER_GRINTEN, 0, + paramsESRI_Van_der_Grinten_I}, + {"Robinson", PROJ_WKT2_NAME_METHOD_ROBINSON, 0, paramsESRI_Robinson}, + {"Two_Point_Equidistant", PROJ_WKT2_NAME_METHOD_TWO_POINT_EQUIDISTANT, 0, + paramsESRI_Two_Point_Equidistant}, + {"Azimuthal_Equidistant", EPSG_NAME_METHOD_MODIFIED_AZIMUTHAL_EQUIDISTANT, + EPSG_CODE_METHOD_MODIFIED_AZIMUTHAL_EQUIDISTANT, + paramsESRI_Azimuthal_Equidistant}, + {"Lambert_Azimuthal_Equal_Area", + EPSG_NAME_METHOD_LAMBERT_AZIMUTHAL_EQUAL_AREA, + EPSG_CODE_METHOD_LAMBERT_AZIMUTHAL_EQUAL_AREA, + paramsESRI_Lambert_Azimuthal_Equal_Area}, + {"Cylindrical_Equal_Area", + EPSG_NAME_METHOD_LAMBERT_CYLINDRICAL_EQUAL_AREA_SPHERICAL, + EPSG_CODE_METHOD_LAMBERT_CYLINDRICAL_EQUAL_AREA_SPHERICAL, + paramsESRI_Cylindrical_Equal_Area}, + {"Hotine_Oblique_Mercator_Two_Point_Center", + PROJ_WKT2_NAME_METHOD_HOTINE_OBLIQUE_MERCATOR_TWO_POINT_NATURAL_ORIGIN, 0, + paramsESRI_Hotine_Oblique_Mercator_Two_Point_Center}, + {"Hotine_Oblique_Mercator_Azimuth_Natural_Origin", + EPSG_NAME_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_A, + EPSG_CODE_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_A, + paramsESRI_Hotine_Oblique_Mercator_Azimuth_Natural_Origin}, + {"Hotine_Oblique_Mercator_Azimuth_Center", + EPSG_NAME_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_B, + EPSG_CODE_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_B, + paramsESRI_Hotine_Oblique_Mercator_Azimuth_Center}, + {"Double_Stereographic", EPSG_NAME_METHOD_OBLIQUE_STEREOGRAPHIC, + EPSG_CODE_METHOD_OBLIQUE_STEREOGRAPHIC, paramsESRI_Double_Stereographic}, + {"Krovak", EPSG_NAME_METHOD_KROVAK, EPSG_CODE_METHOD_KROVAK, + paramsESRI_Krovak_alt1}, + {"Krovak", EPSG_NAME_METHOD_KROVAK_NORTH_ORIENTED, + EPSG_CODE_METHOD_KROVAK_NORTH_ORIENTED, paramsESRI_Krovak_alt2}, + {"New_Zealand_Map_Grid", EPSG_NAME_METHOD_NZMG, EPSG_CODE_METHOD_NZMG, + paramsESRI_New_Zealand_Map_Grid}, + {"Orthographic", EPSG_NAME_METHOD_ORTHOGRAPHIC, + EPSG_CODE_METHOD_ORTHOGRAPHIC, paramsESRI_Orthographic}, + {"Winkel_Tripel", "Winkel Tripel", 0, paramsESRI_Winkel_Tripel}, + {"Aitoff", "Aitoff", 0, paramsESRI_Aitoff}, + {"Craster_Parabolic", "Craster Parabolic", 0, paramsESRI_Craster_Parabolic}, + {"Gnomonic", PROJ_WKT2_NAME_METHOD_GNOMONIC, 0, paramsESRI_Gnomonic}, + {"Stereographic_North_Pole", EPSG_NAME_METHOD_POLAR_STEREOGRAPHIC_VARIANT_B, + EPSG_CODE_METHOD_POLAR_STEREOGRAPHIC_VARIANT_B, + paramsESRI_Stereographic_North_Pole}, + {"Stereographic_South_Pole", EPSG_NAME_METHOD_POLAR_STEREOGRAPHIC_VARIANT_B, + EPSG_CODE_METHOD_POLAR_STEREOGRAPHIC_VARIANT_B, + paramsESRI_Stereographic_South_Pole}, + {"Rectified_Skew_Orthomorphic_Natural_Origin", + EPSG_NAME_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_A, + EPSG_CODE_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_A, + paramsESRI_Rectified_Skew_Orthomorphic_Natural_Origin}, + {"Rectified_Skew_Orthomorphic_Center", + EPSG_NAME_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_B, + EPSG_CODE_METHOD_HOTINE_OBLIQUE_MERCATOR_VARIANT_B, + paramsESRI_Rectified_Skew_Orthomorphic_Center}, + {"Goode_Homolosine", "Goode Homolosine", 0, paramsESRI_Goode_Homolosine}, + {"Equidistant_Cylindrical_Ellipsoidal", + EPSG_NAME_METHOD_EQUIDISTANT_CYLINDRICAL, + EPSG_CODE_METHOD_EQUIDISTANT_CYLINDRICAL, + paramsESRI_Equidistant_Cylindrical_Ellipsoidal}, + {"Laborde_Oblique_Mercator", EPSG_NAME_METHOD_LABORDE_OBLIQUE_MERCATOR, + EPSG_CODE_METHOD_LABORDE_OBLIQUE_MERCATOR, + paramsESRI_Laborde_Oblique_Mercator}, + {"Gnomonic_Ellipsoidal", PROJ_WKT2_NAME_METHOD_GNOMONIC, 0, + paramsESRI_Gnomonic_Ellipsoidal}, + {"Wagner_IV", PROJ_WKT2_NAME_METHOD_WAGNER_IV, 0, paramsESRI_Wagner_IV}, + {"Wagner_V", PROJ_WKT2_NAME_METHOD_WAGNER_V, 0, paramsESRI_Wagner_V}, + {"Wagner_VII", PROJ_WKT2_NAME_METHOD_WAGNER_VII, 0, paramsESRI_Wagner_VII}, + {"Geostationary_Satellite", + PROJ_WKT2_NAME_METHOD_GEOSTATIONARY_SATELLITE_SWEEP_Y, 0, + paramsESRI_Geostationary_Satellite}, + {"Mercator_Auxiliary_Sphere", + EPSG_NAME_METHOD_POPULAR_VISUALISATION_PSEUDO_MERCATOR, + EPSG_CODE_METHOD_POPULAR_VISUALISATION_PSEUDO_MERCATOR, + paramsESRI_Mercator_Auxiliary_Sphere}, +}; + +// --------------------------------------------------------------------------- + +// end of anonymous namespace +} + +//! @endcond + +#endif // ESRI_PROJECTION_MAPPINGS_HH_INCLUDED diff --git a/include/proj/internal/internal.hpp b/include/proj/internal/internal.hpp new file mode 100644 index 00000000..cbf6e259 --- /dev/null +++ b/include/proj/internal/internal.hpp @@ -0,0 +1,190 @@ +/****************************************************************************** + * + * Project: PROJ + * Purpose: ISO19111:2018 implementation + * Author: Even Rouault <even dot rouault at spatialys dot com> + * + ****************************************************************************** + * Copyright (c) 2018, Even Rouault <even dot rouault at spatialys dot com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ****************************************************************************/ + +#ifndef FROM_PROJ_CPP +#error This file should only be included from a PROJ cpp file +#endif + +#ifndef INTERNAL_HH_INCLUDED +#define INTERNAL_HH_INCLUDED + +#if !(__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900)) +#error Must have C++11 or newer. +#endif + +#include <cassert> +#include <cstring> +#include <memory> +#include <string> +#ifndef DOXYGEN_ENABLED +#include <type_traits> // for std::is_base_of +#endif +#include <vector> + +#include "proj/util.hpp" + +//! @cond Doxygen_Suppress + +#if ((defined(__clang__) && \ + (__clang_major__ > 3 || \ + (__clang_major__ == 3 && __clang_minor__ >= 7))) || \ + __GNUC__ >= 7) +/** Macro for fallthrough in a switch case construct */ +#define PROJ_FALLTHROUGH [[clang::fallthrough]]; +#else +/** Macro for fallthrough in a switch case construct */ +#define PROJ_FALLTHROUGH +#endif + +#if defined(__clang__) || defined(_MSC_VER) +#define COMPILER_WARNS_ABOUT_ABSTRACT_VBASE_INIT +#endif + +#if !(defined(__clang__) && __clang_major__ < 5) && !defined(__INTEL_COMPILER) +#define SUPPORT_DELETED_FUNCTION +#endif + +NS_PROJ_START + +namespace operation { +class OperationParameterValue; +} // namespace operation + +namespace internal { + +/** Use cpl::down_cast<Derived*>(pointer_to_base) as equivalent of + * static_cast<Derived*>(pointer_to_base) with safe checking in debug + * mode. + * + * Only works if no virtual inheritance is involved. + * + * @param f pointer to a base class + * @return pointer to a derived class + */ +template <typename To, typename From> inline To down_cast(From *f) { + static_assert( + (std::is_base_of<From, typename std::remove_pointer<To>::type>::value), + "target type not derived from source type"); + assert(f == nullptr || dynamic_cast<To>(f) != nullptr); + return static_cast<To>(f); +} + +/* Borrowed from C++14 */ +template <typename T, typename... Args> +std::unique_ptr<T> make_unique(Args &&... args) { + return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); +} + +PROJ_FOR_TEST std::string replaceAll(const std::string &str, + const std::string &before, + const std::string &after); + +size_t ci_find(const std::string &osStr, const char *needle) noexcept; + +size_t ci_find(const std::string &osStr, const std::string &needle, + size_t startPos = 0) noexcept; + +inline bool starts_with(const std::string &str, + const std::string &prefix) noexcept { + if (str.size() < prefix.size()) { + return false; + } + return std::memcmp(str.c_str(), prefix.c_str(), prefix.size()) == 0; +} + +inline bool starts_with(const std::string &str, const char *prefix) noexcept { + const size_t prefixSize = std::strlen(prefix); + if (str.size() < prefixSize) { + return false; + } + return std::memcmp(str.c_str(), prefix, prefixSize) == 0; +} + +bool ci_starts_with(const char *str, const char *prefix) noexcept; + +bool ci_starts_with(const std::string &str, const std::string &prefix) noexcept; + +bool ends_with(const std::string &str, const std::string &suffix) noexcept; + +PROJ_FOR_TEST std::string tolower(const std::string &osStr); + +std::string toupper(const std::string &osStr); + +PROJ_FOR_TEST std::vector<std::string> split(const std::string &osStr, + char separator); + +bool ci_equal(const char *a, const char *b) noexcept; + +#ifdef SUPPORT_DELETED_FUNCTION +bool ci_equal(const char *a, const std::string &b) = delete; +#endif + +PROJ_FOR_TEST bool ci_equal(const std::string &a, const char *b) noexcept; + +PROJ_FOR_TEST bool ci_equal(const std::string &a, + const std::string &b) noexcept; + +std::string stripQuotes(const std::string &osStr); + +std::string toString(int val); + +PROJ_FOR_TEST std::string toString(double val, int precision = 15); + +PROJ_FOR_TEST double +c_locale_stod(const std::string &s); // throw(std::invalid_argument) + +#ifdef SUPPORT_DELETED_FUNCTION +std::string concat(const std::string &, const std::string &) = delete; +std::string concat(const char *, const char *) = delete; +#endif +std::string concat(const char *a, const std::string &b); +#ifdef SUPPORT_DELETED_FUNCTION +std::string concat(const std::string &, const char *) = delete; +std::string concat(const char *, const char *, const char *) = delete; +std::string concat(const char *, const char *, const std::string &) = delete; +#endif +std::string concat(const char *a, const std::string &b, const char *c); +#ifdef SUPPORT_DELETED_FUNCTION +std::string concat(const char *, const std::string &, + const std::string &) = delete; +std::string concat(const std::string &, const char *, const char *) = delete; +std::string concat(const std::string &, const char *, + const std::string &) = delete; +std::string concat(const std::string &, const std::string &, + const char *) = delete; +std::string concat(const std::string &, const std::string &, + const std::string &) = delete; +#endif + +} // namespace internal + +NS_PROJ_END + +//! @endcond + +#endif // INTERNAL_HH_INCLUDED diff --git a/include/proj/internal/io_internal.hpp b/include/proj/internal/io_internal.hpp new file mode 100644 index 00000000..8a32c6eb --- /dev/null +++ b/include/proj/internal/io_internal.hpp @@ -0,0 +1,163 @@ +/****************************************************************************** + * + * Project: PROJ + * Purpose: ISO19111:2018 implementation + * Author: Even Rouault <even dot rouault at spatialys dot com> + * + ****************************************************************************** + * Copyright (c) 2018, Even Rouault <even dot rouault at spatialys dot com> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + ****************************************************************************/ + +#ifndef FROM_PROJ_CPP +#error This file should only be included from a PROJ cpp file +#endif + +#ifndef IO_INTERNAL_HH_INCLUDED +#define IO_INTERNAL_HH_INCLUDED + +#include <string> +#include <vector> + +#include "proj/util.hpp" + +//! @cond Doxygen_Suppress + +NS_PROJ_START + +namespace io { + +// --------------------------------------------------------------------------- + +class WKTConstants { + public: + // WKT1 + static const std::string GEOCCS; + static const std::string GEOGCS; + static const std::string DATUM; // WKT2 preferred too + static const std::string UNIT; + static const std::string SPHEROID; + static const std::string AXIS; // WKT2 too + static const std::string PRIMEM; // WKT2 too + static const std::string AUTHORITY; + static const std::string PROJCS; + static const std::string PROJECTION; + static const std::string PARAMETER; // WKT2 too + static const std::string VERT_CS; + static const std::string VERT_DATUM; + static const std::string COMPD_CS; + static const std::string TOWGS84; // WKT1 only + static const std::string EXTENSION; // WKT1 only - GDAL specific + static const std::string LOCAL_CS; // WKT1 only + static const std::string LOCAL_DATUM; // WKT1 only + + // WKT2 preferred + static const std::string GEODCRS; + static const std::string LENGTHUNIT; + static const std::string ANGLEUNIT; + static const std::string SCALEUNIT; + static const std::string TIMEUNIT; + static const std::string ELLIPSOID; + static const std::string CS; + static const std::string ID; + static const std::string PROJCRS; + static const std::string BASEGEODCRS; + static const std::string MERIDIAN; + static const std::string ORDER; + static const std::string ANCHOR; + static const std::string CONVERSION; + static const std::string METHOD; + static const std::string REMARK; + static const std::string GEOGCRS; // WKT2-2018 + static const std::string BASEGEOGCRS; // WKT2-2018 + static const std::string SCOPE; + static const std::string AREA; + static const std::string BBOX; + static const std::string CITATION; + static const std::string URI; + static const std::string VERTCRS; + static const std::string VDATUM; + static const std::string COMPOUNDCRS; + static const std::string PARAMETERFILE; + static const std::string COORDINATEOPERATION; + static const std::string SOURCECRS; + static const std::string TARGETCRS; + static const std::string INTERPOLATIONCRS; + static const std::string OPERATIONACCURACY; + static const std::string CONCATENATEDOPERATION; // WKT2-2018 + static const std::string STEP; // WKT2-2018 + static const std::string BOUNDCRS; + static const std::string ABRIDGEDTRANSFORMATION; + static const std::string DERIVINGCONVERSION; + static const std::string TDATUM; + static const std::string CALENDAR; // WKT2-2018 + static const std::string TIMEORIGIN; + static const std::string TIMECRS; + static const std::string VERTICALEXTENT; + static const std::string TIMEEXTENT; + static const std::string USAGE; // WKT2-2018 + static const std::string DYNAMIC; // WKT2-2018 + static const std::string FRAMEEPOCH; // WKT2-2018 + static const std::string MODEL; // WKT2-2018 + static const std::string VELOCITYGRID; // WKT2-2018 + static const std::string ENSEMBLE; // WKT2-2018 + static const std::string MEMBER; // WKT2-2018 + static const std::string ENSEMBLEACCURACY; // WKT2-2018 + static const std::string DERIVEDPROJCRS; // WKT2-2018 + static const std::string BASEPROJCRS; // WKT2-2018 + static const std::string EDATUM; + static const std::string ENGCRS; + static const std::string PDATUM; + static const std::string PARAMETRICCRS; + static const std::string PARAMETRICUNIT; + static const std::string BASEVERTCRS; + static const std::string BASEENGCRS; + static const std::string BASEPARAMCRS; + static const std::string BASETIMECRS; + + // WKT2 alternate (longer or shorter) + static const std::string GEODETICCRS; + static const std::string GEODETICDATUM; + static const std::string PROJECTEDCRS; + static const std::string PRIMEMERIDIAN; + static const std::string GEOGRAPHICCRS; // WKT2-2018 + static const std::string TRF; // WKT2-2018 + static const std::string VERTICALCRS; + static const std::string VERTICALDATUM; + static const std::string VRF; // WKT2-2018 + static const std::string TIMEDATUM; + static const std::string ENGINEERINGDATUM; + static const std::string ENGINEERINGCRS; + static const std::string PARAMETRICDATUM; + + static const std::vector<std::string> &constants() { return constants_; } + + private: + static std::vector<std::string> constants_; + static const char *createAndAddToConstantList(const char *text); +}; + +} // namespace io + +NS_PROJ_END + +//! @endcond + +#endif // IO_INTERNAL_HH_INCLUDED diff --git a/include/proj/internal/lru_cache.hpp b/include/proj/internal/lru_cache.hpp new file mode 100644 index 00000000..2f2c8bd9 --- /dev/null +++ b/include/proj/internal/lru_cache.hpp @@ -0,0 +1,223 @@ +/* + * LRUCache11 - a templated C++11 based LRU cache class that allows + * specification of + * key, value and optionally the map container type (defaults to + * std::unordered_map) + * By using the std::map and a linked list of keys it allows O(1) insert, delete + * and + * refresh operations. + * + * This is a header-only library and all you need is the LRUCache11.hpp file + * + * Github: https://github.com/mohaps/lrucache11 + * + * This is a follow-up to the LRUCache project - + * https://github.com/mohaps/lrucache + * + * Copyright (c) 2012-22 SAURAV MOHAPATRA <mohaps@gmail.com> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +/*! @cond Doxygen_Suppress */ + +#pragma once +#include <algorithm> +#include <cstdint> +#include <list> +#include <mutex> +#include <stdexcept> +#include <thread> +#include <unordered_map> + +NS_PROJ_START +namespace lru11 { +/* + * a noop lockable concept that can be used in place of std::mutex + */ +class NullLock { + public: + // cppcheck-suppress functionStatic + void lock() {} + // cppcheck-suppress functionStatic + void unlock() {} + // cppcheck-suppress functionStatic + bool try_lock() { return true; } +}; + +/** + * error raised when a key not in cache is passed to get() + */ +class KeyNotFound : public std::invalid_argument { + public: + KeyNotFound() : std::invalid_argument("key_not_found") {} + ~KeyNotFound() override; +}; + +#ifndef LRU11_DO_NOT_DEFINE_OUT_OF_CLASS_METHODS +KeyNotFound::~KeyNotFound() = default; +#endif + +template <typename K, typename V> +struct KeyValuePair { + public: + K key; + V value; + + KeyValuePair(const K& k, const V& v) : key(k), value(v) {} +}; + +/** + * The LRU Cache class templated by + * Key - key type + * Value - value type + * MapType - an associative container like std::unordered_map + * LockType - a lock type derived from the Lock class (default: + *NullLock = no synchronization) + * + * The default NullLock based template is not thread-safe, however passing + *Lock=std::mutex will make it + * thread-safe + */ +template <class Key, class Value, class Lock = NullLock, + class Map = std::unordered_map< + Key, typename std::list<KeyValuePair<Key, Value>>::iterator>> +class Cache { + public: + typedef KeyValuePair<Key, Value> node_type; + typedef std::list<KeyValuePair<Key, Value>> list_type; + typedef Map map_type; + typedef Lock lock_type; + using Guard = std::lock_guard<lock_type>; + /** + * the max size is the hard limit of keys and (maxSize + elasticity) is the + * soft limit + * the cache is allowed to grow till maxSize + elasticity and is pruned back + * to maxSize keys + * set maxSize = 0 for an unbounded cache (but in that case, you're better off + * using a std::unordered_map + * directly anyway! :) + */ + explicit Cache(size_t maxSize = 64, size_t elasticity = 10) + : maxSize_(maxSize), elasticity_(elasticity) {} + virtual ~Cache() = default; + size_t size() const { + Guard g(lock_); + return cache_.size(); + } + bool empty() const { + Guard g(lock_); + return cache_.empty(); + } + void clear() { + Guard g(lock_); + cache_.clear(); + keys_.clear(); + } + void insert(const Key& k, const Value& v) { + Guard g(lock_); + const auto iter = cache_.find(k); + if (iter != cache_.end()) { + iter->second->value = v; + keys_.splice(keys_.begin(), keys_, iter->second); + return; + } + + keys_.emplace_front(k, v); + cache_[k] = keys_.begin(); + prune(); + } + bool tryGet(const Key& kIn, Value& vOut) { + Guard g(lock_); + const auto iter = cache_.find(kIn); + if (iter == cache_.end()) { + return false; + } + keys_.splice(keys_.begin(), keys_, iter->second); + vOut = iter->second->value; + return true; + } + /** + * The const reference returned here is only + * guaranteed to be valid till the next insert/delete + */ + const Value& get(const Key& k) { + Guard g(lock_); + const auto iter = cache_.find(k); + if (iter == cache_.end()) { + throw KeyNotFound(); + } + keys_.splice(keys_.begin(), keys_, iter->second); + return iter->second->value; + } + /** + * returns a copy of the stored object (if found) + */ + Value getCopy(const Key& k) { + return get(k); + } + bool remove(const Key& k) { + Guard g(lock_); + auto iter = cache_.find(k); + if (iter == cache_.end()) { + return false; + } + keys_.erase(iter->second); + cache_.erase(iter); + return true; + } + bool contains(const Key& k) { + Guard g(lock_); + return cache_.find(k) != cache_.end(); + } + + size_t getMaxSize() const { return maxSize_; } + size_t getElasticity() const { return elasticity_; } + size_t getMaxAllowedSize() const { return maxSize_ + elasticity_; } + template <typename F> + void cwalk(F& f) const { + Guard g(lock_); + std::for_each(keys_.begin(), keys_.end(), f); + } + + protected: + size_t prune() { + size_t maxAllowed = maxSize_ + elasticity_; + if (maxSize_ == 0 || cache_.size() <= maxAllowed) { /* ERO: changed < to <= */ + return 0; + } + size_t count = 0; + while (cache_.size() > maxSize_) { + cache_.erase(keys_.back().key); + keys_.pop_back(); + ++count; + } + return count; + } + + private: + // Dissallow copying. + Cache(const Cache&) = delete; + Cache& operator=(const Cache&) = delete; + + mutable Lock lock_{}; + Map cache_{}; + list_type keys_{}; + size_t maxSize_; + size_t elasticity_; +}; + +} // namespace LRUCache11 +NS_PROJ_END + +/*! @endcond */ |
