Skip to content

Commit 64d6d5f

Browse files
committed
Equidistant Conic: add mapping to new EPSG:1119 method
1 parent 345d92c commit 64d6d5f

File tree

9 files changed

+117
-51
lines changed

9 files changed

+117
-51
lines changed

data/sql/proj_db_table_defs.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ BEGIN
504504
'EPSG_1078_Equal Earth',
505505
'EPSG_1102_Lambert Conic Conformal (1SP variant B)',
506506
'EPSG_1111_Transverse Mercator 3D',
507+
'EPSG_1119_Equidistant Conic',
507508
'EPSG_9602_Geographic/geocentric conversions',
508509
'EPSG_9659_Geographic3D to 2D conversion',
509510
'EPSG_9801_Lambert Conic Conformal (1SP)',

include/proj/coordinateoperation.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,12 +1105,12 @@ class PROJ_GCC_DLL Conversion : public SingleOperation {
11051105

11061106
PROJ_DLL static ConversionNNPtr
11071107
createEquidistantConic(const util::PropertyMap &properties,
1108-
const common::Angle &centerLat,
1109-
const common::Angle &centerLong,
1108+
const common::Angle &latitudeFalseOrigin,
1109+
const common::Angle &longitudeFalseOrigin,
11101110
const common::Angle &latitudeFirstParallel,
11111111
const common::Angle &latitudeSecondParallel,
1112-
const common::Length &falseEasting,
1113-
const common::Length &falseNorthing);
1112+
const common::Length &eastingFalseOrigin,
1113+
const common::Length &northingFalseOrigin);
11141114

11151115
PROJ_DLL static ConversionNNPtr
11161116
createEckertI(const util::PropertyMap &properties,

scripts/build_esri_projection_mapping.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,14 @@
299299
- Latitude_Of_Origin: EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN
300300
301301
- Equidistant_Conic:
302-
WKT2_name: PROJ_WKT2_NAME_METHOD_EQUIDISTANT_CONIC
302+
WKT2_name: EPSG_NAME_METHOD_EQUIDISTANT_CONIC
303303
Params:
304-
- False_Easting: EPSG_NAME_PARAMETER_FALSE_EASTING
305-
- False_Northing: EPSG_NAME_PARAMETER_FALSE_NORTHING
306-
- Central_Meridian: EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN
304+
- False_Easting: EPSG_NAME_PARAMETER_EASTING_FALSE_ORIGIN
305+
- False_Northing: EPSG_NAME_PARAMETER_NORTHING_FALSE_ORIGIN
306+
- Central_Meridian: EPSG_NAME_PARAMETER_LONGITUDE_FALSE_ORIGIN
307307
- Standard_Parallel_1: EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL
308308
- Standard_Parallel_2: EPSG_NAME_PARAMETER_LATITUDE_2ND_STD_PARALLEL
309-
- Latitude_Of_Origin: EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN
309+
- Latitude_Of_Origin: EPSG_NAME_PARAMETER_LATITUDE_FALSE_ORIGIN
310310
311311
- Cassini:
312312
WKT2_name: EPSG_NAME_METHOD_CASSINI_SOLDNER

src/iso19111/operation/conversion.cpp

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -917,31 +917,32 @@ ConversionNNPtr Conversion::createCassiniSoldner(
917917
* <a href="../../../operations/projections/eqdc.html">
918918
* Equidistant Conic</a> projection method.
919919
*
920-
* There is no equivalent in EPSG.
920+
* This method is defined as
921+
* <a href="https://epsg.org/coord-operation-method_1119/index.html">
922+
* EPSG:1119</a>.
921923
*
922-
* @note Although not found in EPSG, the order of arguments is conformant with
923-
* the "spirit" of EPSG and different than OGRSpatialReference::setEC() of GDAL
924-
*&lt;= 2.3 * @param properties See \ref general_properties of the conversion.
925-
*If the name
924+
* @param properties See \ref general_properties of the conversion. If the name
926925
* is not provided, it is automatically set.
927-
*
928-
* @param centerLat See \ref center_latitude
929-
* @param centerLong See \ref center_longitude
926+
* @param latitudeFalseOrigin See \ref latitude_false_origin
927+
* @param longitudeFalseOrigin See \ref longitude_false_origin
930928
* @param latitudeFirstParallel See \ref latitude_first_std_parallel
931929
* @param latitudeSecondParallel See \ref latitude_second_std_parallel
932-
* @param falseEasting See \ref false_easting
933-
* @param falseNorthing See \ref false_northing
930+
* @param eastingFalseOrigin See \ref easting_false_origin
931+
* @param northingFalseOrigin See \ref northing_false_origin
934932
* @return a new Conversion.
935933
*/
936-
ConversionNNPtr Conversion::createEquidistantConic(
937-
const util::PropertyMap &properties, const common::Angle &centerLat,
938-
const common::Angle &centerLong, const common::Angle &latitudeFirstParallel,
939-
const common::Angle &latitudeSecondParallel,
940-
const common::Length &falseEasting, const common::Length &falseNorthing) {
941-
return create(properties, PROJ_WKT2_NAME_METHOD_EQUIDISTANT_CONIC,
942-
createParams(centerLat, centerLong, latitudeFirstParallel,
943-
latitudeSecondParallel, falseEasting,
944-
falseNorthing));
934+
ConversionNNPtr
935+
Conversion::createEquidistantConic(const util::PropertyMap &properties,
936+
const common::Angle &latitudeFalseOrigin,
937+
const common::Angle &longitudeFalseOrigin,
938+
const common::Angle &latitudeFirstParallel,
939+
const common::Angle &latitudeSecondParallel,
940+
const common::Length &eastingFalseOrigin,
941+
const common::Length &northingFalseOrigin) {
942+
return create(properties, EPSG_CODE_METHOD_EQUIDISTANT_CONIC,
943+
createParams(latitudeFalseOrigin, longitudeFalseOrigin,
944+
latitudeFirstParallel, latitudeSecondParallel,
945+
eastingFalseOrigin, northingFalseOrigin));
945946
}
946947

947948
// ---------------------------------------------------------------------------

src/iso19111/operation/esriparammappings.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,18 +399,18 @@ static const ESRIParamMapping paramsESRI_Polar_Stereographic_Variant_A[] = {
399399
{nullptr, nullptr, 0, "0.0", false}};
400400

401401
static const ESRIParamMapping paramsESRI_Equidistant_Conic[] = {
402-
{"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING,
403-
EPSG_CODE_PARAMETER_FALSE_EASTING, "0.0", false},
404-
{"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING,
405-
EPSG_CODE_PARAMETER_FALSE_NORTHING, "0.0", false},
406-
{"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN,
407-
EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, "0.0", false},
402+
{"False_Easting", EPSG_NAME_PARAMETER_EASTING_FALSE_ORIGIN,
403+
EPSG_CODE_PARAMETER_EASTING_FALSE_ORIGIN, "0.0", false},
404+
{"False_Northing", EPSG_NAME_PARAMETER_NORTHING_FALSE_ORIGIN,
405+
EPSG_CODE_PARAMETER_NORTHING_FALSE_ORIGIN, "0.0", false},
406+
{"Central_Meridian", EPSG_NAME_PARAMETER_LONGITUDE_FALSE_ORIGIN,
407+
EPSG_CODE_PARAMETER_LONGITUDE_FALSE_ORIGIN, "0.0", false},
408408
{"Standard_Parallel_1", EPSG_NAME_PARAMETER_LATITUDE_1ST_STD_PARALLEL,
409409
EPSG_CODE_PARAMETER_LATITUDE_1ST_STD_PARALLEL, "0.0", false},
410410
{"Standard_Parallel_2", EPSG_NAME_PARAMETER_LATITUDE_2ND_STD_PARALLEL,
411411
EPSG_CODE_PARAMETER_LATITUDE_2ND_STD_PARALLEL, "0.0", false},
412-
{"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN,
413-
EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, "0.0", false},
412+
{"Latitude_Of_Origin", EPSG_NAME_PARAMETER_LATITUDE_FALSE_ORIGIN,
413+
EPSG_CODE_PARAMETER_LATITUDE_FALSE_ORIGIN, "0.0", false},
414414
{nullptr, nullptr, 0, "0.0", false}};
415415

416416
static const ESRIParamMapping paramsESRI_Cassini[] = {

src/iso19111/operation/parammappings.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static const ParamMapping paramLongFalseOriginLongOfCenter = {
171171
EPSG_CODE_PARAMETER_LONGITUDE_FALSE_ORIGIN, WKT1_LONGITUDE_OF_CENTER,
172172
common::UnitOfMeasure::Type::ANGULAR, lon_0};
173173

174-
static const ParamMapping *const paramsAEA[] = {
174+
static const ParamMapping *const paramsAEA_EQDC[] = {
175175
&paramLatFalseOriginLatOfCenter,
176176
&paramLongFalseOriginLongOfCenter,
177177
&paramLatitude1stStdParallel,
@@ -608,7 +608,7 @@ static const MethodMapping projectionMethodMappings[] = {
608608
paramsTMG},
609609

610610
{EPSG_NAME_METHOD_ALBERS_EQUAL_AREA, EPSG_CODE_METHOD_ALBERS_EQUAL_AREA,
611-
"Albers_Conic_Equal_Area", "aea", nullptr, paramsAEA},
611+
"Albers_Conic_Equal_Area", "aea", nullptr, paramsAEA_EQDC},
612612

613613
{EPSG_NAME_METHOD_LAMBERT_CONIC_CONFORMAL_1SP,
614614
EPSG_CODE_METHOD_LAMBERT_CONIC_CONFORMAL_1SP,
@@ -666,6 +666,12 @@ static const MethodMapping projectionMethodMappings[] = {
666666
EPSG_CODE_METHOD_HYPERBOLIC_CASSINI_SOLDNER, nullptr, "cass", "hyperbolic",
667667
paramsNatOrigin},
668668

669+
// Definition to be put before PROJ_WKT2_NAME_METHOD_EQUIDISTANT_CONIC
670+
{EPSG_NAME_METHOD_EQUIDISTANT_CONIC, EPSG_CODE_METHOD_EQUIDISTANT_CONIC,
671+
"Equidistant_Conic", "eqdc", nullptr, paramsAEA_EQDC},
672+
673+
// Definition before EPSG codified it. To be put after entry for
674+
// EPSG_NAME_METHOD_EQUIDISTANT_CONIC
669675
{PROJ_WKT2_NAME_METHOD_EQUIDISTANT_CONIC, 0, "Equidistant_Conic", "eqdc",
670676
nullptr, paramsEQDC},
671677

src/proj_constants.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@
105105

106106
#define PROJ_WKT2_NAME_METHOD_EQUIDISTANT_CONIC "Equidistant Conic"
107107

108+
#define EPSG_NAME_METHOD_EQUIDISTANT_CONIC "Equidistant Conic"
109+
#define EPSG_CODE_METHOD_EQUIDISTANT_CONIC 1119
110+
108111
#define PROJ_WKT2_NAME_METHOD_ECKERT_I "Eckert I"
109112

110113
#define PROJ_WKT2_NAME_METHOD_ECKERT_II "Eckert II"

test/unit/test_io.cpp

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,6 +2377,60 @@ TEST(wkt_parse, wkt2_2019_projected_with_base_geocentric) {
23772377

23782378
// ---------------------------------------------------------------------------
23792379

2380+
TEST(wkt_parse, wkt2_2019_eqdc_non_epsg) {
2381+
// Example from WKT2:2019
2382+
auto wkt = "PROJCRS[\"unknown\",\n"
2383+
" BASEGEOGCRS[\"unknown\",\n"
2384+
" DATUM[\"World Geodetic System 1984\",\n"
2385+
" ELLIPSOID[\"WGS 84\",6378137,298.257223563,\n"
2386+
" LENGTHUNIT[\"metre\",1]],\n"
2387+
" ID[\"EPSG\",6326]],\n"
2388+
" PRIMEM[\"Greenwich\",0,\n"
2389+
" ANGLEUNIT[\"degree\",0.0174532925199433],\n"
2390+
" ID[\"EPSG\",8901]]],\n"
2391+
" CONVERSION[\"unknown\",\n"
2392+
" METHOD[\"Equidistant Conic\"],\n"
2393+
" PARAMETER[\"Latitude of natural origin\",1,\n"
2394+
" ANGLEUNIT[\"degree\",0.0174532925199433],\n"
2395+
" ID[\"EPSG\",8801]],\n"
2396+
" PARAMETER[\"Longitude of natural origin\",2,\n"
2397+
" ANGLEUNIT[\"degree\",0.0174532925199433],\n"
2398+
" ID[\"EPSG\",8802]],\n"
2399+
" PARAMETER[\"Latitude of 1st standard parallel\",3,\n"
2400+
" ANGLEUNIT[\"degree\",0.0174532925199433],\n"
2401+
" ID[\"EPSG\",8823]],\n"
2402+
" PARAMETER[\"Latitude of 2nd standard parallel\",4,\n"
2403+
" ANGLEUNIT[\"degree\",0.0174532925199433],\n"
2404+
" ID[\"EPSG\",8824]],\n"
2405+
" PARAMETER[\"False easting\",5,\n"
2406+
" LENGTHUNIT[\"metre\",1],\n"
2407+
" ID[\"EPSG\",8806]],\n"
2408+
" PARAMETER[\"False northing\",6,\n"
2409+
" LENGTHUNIT[\"metre\",1],\n"
2410+
" ID[\"EPSG\",8807]]],\n"
2411+
" CS[Cartesian,2],\n"
2412+
" AXIS[\"(E)\",east,\n"
2413+
" ORDER[1],\n"
2414+
" LENGTHUNIT[\"metre\",1,\n"
2415+
" ID[\"EPSG\",9001]]],\n"
2416+
" AXIS[\"(N)\",north,\n"
2417+
" ORDER[2],\n"
2418+
" LENGTHUNIT[\"metre\",1,\n"
2419+
" ID[\"EPSG\",9001]]]]";
2420+
auto obj = WKTParser().createFromWKT(wkt);
2421+
auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
2422+
ASSERT_TRUE(crs != nullptr);
2423+
2424+
EXPECT_EQ(
2425+
crs->exportToPROJString(
2426+
PROJStringFormatter::create(PROJStringFormatter::Convention::PROJ_4)
2427+
.get()),
2428+
"+proj=eqdc +lat_0=1 +lon_0=2 +lat_1=3 +lat_2=4 +x_0=5 +y_0=6 "
2429+
"+datum=WGS84 +units=m +no_defs +type=crs");
2430+
}
2431+
2432+
// ---------------------------------------------------------------------------
2433+
23802434
TEST(crs, projected_angular_unit_from_primem) {
23812435
auto obj = WKTParser().createFromWKT(
23822436
"PROJCRS[\"NTF (Paris) / Lambert Nord France\",\n"
@@ -6422,12 +6476,12 @@ static const struct {
64226476
{"Latitude_Of_Origin", 6}},
64236477
"Equidistant Conic",
64246478
{
6425-
{"Latitude of natural origin", 6},
6426-
{"Longitude of natural origin", 3},
6479+
{"Latitude of false origin", 6},
6480+
{"Longitude of false origin", 3},
64276481
{"Latitude of 1st standard parallel", 4},
64286482
{"Latitude of 2nd standard parallel", 5},
6429-
{"False easting", 1},
6430-
{"False northing", 2},
6483+
{"Easting at false origin", 1},
6484+
{"Northing at false origin", 2},
64316485
}},
64326486

64336487
{"Cassini",

test/unit/test_operation.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,25 +2017,26 @@ TEST(operation, equidistant_conic_export) {
20172017

20182018
EXPECT_EQ(conv->exportToWKT(WKTFormatter::create().get()),
20192019
"CONVERSION[\"Equidistant Conic\",\n"
2020-
" METHOD[\"Equidistant Conic\"],\n"
2021-
" PARAMETER[\"Latitude of natural origin\",1,\n"
2020+
" METHOD[\"Equidistant Conic\",\n"
2021+
" ID[\"EPSG\",1119]],\n"
2022+
" PARAMETER[\"Latitude of false origin\",1,\n"
20222023
" ANGLEUNIT[\"degree\",0.0174532925199433],\n"
2023-
" ID[\"EPSG\",8801]],\n"
2024-
" PARAMETER[\"Longitude of natural origin\",2,\n"
2024+
" ID[\"EPSG\",8821]],\n"
2025+
" PARAMETER[\"Longitude of false origin\",2,\n"
20252026
" ANGLEUNIT[\"degree\",0.0174532925199433],\n"
2026-
" ID[\"EPSG\",8802]],\n"
2027+
" ID[\"EPSG\",8822]],\n"
20272028
" PARAMETER[\"Latitude of 1st standard parallel\",3,\n"
20282029
" ANGLEUNIT[\"degree\",0.0174532925199433],\n"
20292030
" ID[\"EPSG\",8823]],\n"
20302031
" PARAMETER[\"Latitude of 2nd standard parallel\",4,\n"
20312032
" ANGLEUNIT[\"degree\",0.0174532925199433],\n"
20322033
" ID[\"EPSG\",8824]],\n"
2033-
" PARAMETER[\"False easting\",5,\n"
2034+
" PARAMETER[\"Easting at false origin\",5,\n"
20342035
" LENGTHUNIT[\"metre\",1],\n"
2035-
" ID[\"EPSG\",8806]],\n"
2036-
" PARAMETER[\"False northing\",6,\n"
2036+
" ID[\"EPSG\",8826]],\n"
2037+
" PARAMETER[\"Northing at false origin\",6,\n"
20372038
" LENGTHUNIT[\"metre\",1],\n"
2038-
" ID[\"EPSG\",8807]]]");
2039+
" ID[\"EPSG\",8827]]]");
20392040

20402041
EXPECT_EQ(
20412042
conv->exportToWKT(

0 commit comments

Comments
 (0)