diff --git a/data/sql/esri.sql b/data/sql/esri.sql index b98522c9c9..3b5ae0d46e 100644 --- a/data/sql/esri.sql +++ b/data/sql/esri.sql @@ -1,7 +1,7 @@ --- This file has been generated by scripts/build_db_from_esri.py. DO NOT EDIT ! INSERT INTO "metadata" VALUES('ESRI.VERSION', 'ArcGIS Pro 3.3'); -INSERT INTO "metadata" VALUES('ESRI.DATE', '2024-05-07'); +INSERT INTO "metadata" VALUES('ESRI.DATE', '2024-08-16'); INSERT INTO alias_name VALUES('unit_of_measure','EPSG','1025','Millimeter','ESRI'); INSERT INTO alias_name VALUES('unit_of_measure','EPSG','1033','Centimeter','ESRI'); INSERT INTO alias_name VALUES('unit_of_measure','EPSG','9001','Meter','ESRI'); @@ -10756,7 +10756,9 @@ INSERT INTO "usage" VALUES('ESRI', 'CONV_102459_USAGE','conversion','ESRI','1024 INSERT INTO "projected_crs" VALUES('ESRI','102459','NAD_1983_Idaho-Ada_County',NULL,'EPSG','4497','EPSG','4269','ESRI','102459',NULL,0); INSERT INTO "usage" VALUES('ESRI', 'PCRS_102459_USAGE','projected_crs','ESRI','102459','ESRI','57','EPSG','1024'); INSERT INTO "extent" VALUES('ESRI','58','HJAIA - Hartsfield-Jackson Atlanta Intl Airport','HJAIA - Hartsfield-Jackson Atlanta Intl Airport',33.590879,33.68427937,-84.502368,-84.351204,0); -INSERT INTO "projected_crs" VALUES('ESRI','102460','HJAIA_AirportGrid_2Mar10',NULL,NULL,NULL,'EPSG','4269',NULL,NULL,'PROJCS["HJAIA_AirportGrid_2Mar10",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Local"],PARAMETER["False_Easting",11233.741],PARAMETER["False_Northing",3076.34],PARAMETER["Scale_Factor",1.000047],PARAMETER["Azimuth",-0.01935],PARAMETER["Longitude_Of_Center",-84.4306922136],PARAMETER["Latitude_Of_Center",33.6340844042],UNIT["Foot_US",0.3048006096012192]]',0); +INSERT INTO "conversion" VALUES('ESRI','102460','unnamed',NULL,'EPSG','1130','Local Orthographic','EPSG','8811','Latitude of projection centre',33.6340844042,'EPSG','9102','EPSG','8812','Longitude of projection centre',-84.4306922136,'EPSG','9102','EPSG','8813','Azimuth at projection centre',-0.01935,'EPSG','9102','EPSG','8815','Scale factor at projection centre',1.000047,'EPSG','9201','EPSG','8816','Easting at projection centre',11233.741,'EPSG','9003','EPSG','8817','Northing at projection centre',3076.34,'EPSG','9003',NULL,NULL,NULL,NULL,NULL,NULL,0); +INSERT INTO "usage" VALUES('ESRI', 'CONV_102460_USAGE','conversion','ESRI','102460','ESRI','58','EPSG','1024'); +INSERT INTO "projected_crs" VALUES('ESRI','102460','HJAIA_AirportGrid_2Mar10',NULL,'EPSG','4497','EPSG','4269','ESRI','102460',NULL,0); INSERT INTO "usage" VALUES('ESRI', 'PCRS_102460_USAGE','projected_crs','ESRI','102460','ESRI','58','EPSG','1024'); INSERT INTO "conversion" VALUES('ESRI','102461','unnamed',NULL,'EPSG','9807','Transverse Mercator','EPSG','8801','Latitude of natural origin',18.83333333333333,'EPSG','9102','EPSG','8802','Longitude of natural origin',-155.5,'EPSG','9102','EPSG','8805','Scale factor at natural origin',0.9999666666666667,'EPSG','9201','EPSG','8806','False easting',1640416.666666667,'EPSG','9003','EPSG','8807','False northing',0.0,'EPSG','9003',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0); INSERT INTO "usage" VALUES('ESRI', 'CONV_102461_USAGE','conversion','ESRI','102461','EPSG','1546','EPSG','1024'); diff --git a/scripts/build_db_from_esri.py b/scripts/build_db_from_esri.py index 47075ba1b6..4e85e69622 100755 --- a/scripts/build_db_from_esri.py +++ b/scripts/build_db_from_esri.py @@ -1064,6 +1064,8 @@ def get_cs_from_false_easting_and_northing(params: Dict[str, ParameterValue]) -> 8813: 'Azimuth at projection centre', 8814: 'Angle from Rectified to Skew Grid', 8815: 'Scale factor at projection centre', + 8816: 'Easting at projection centre', + 8817: 'Northing at projection centre', 8821: 'Latitude of false origin', 8822: 'Longitude of false origin', 8823: 'Latitude of 1st standard parallel', @@ -1175,6 +1177,18 @@ class ConversionMapping: 8807: 'False_Northing', } ), + 'Local': ConversionMapping( + epsg_code='1130', + epsg_name='Local Orthographic', + param_mapping={ + 8811: 'Latitude_Of_Center', + 8812: 'Longitude_Of_Center', + 8813: 'Azimuth', + 8815: 'Scale_Factor', + 8816: 'False_Easting', + 8817: 'False_Northing', + } + ), } diff --git a/scripts/build_esri_projection_mapping.py b/scripts/build_esri_projection_mapping.py index 9b02ceaebe..5b1a2535db 100644 --- a/scripts/build_esri_projection_mapping.py +++ b/scripts/build_esri_projection_mapping.py @@ -458,12 +458,12 @@ - Local: WKT2_name: EPSG_NAME_METHOD_LOCAL_ORTHOGRAPHIC Params: - - False_Easting: EPSG_NAME_PARAMETER_FALSE_EASTING - - False_Northing: EPSG_NAME_PARAMETER_FALSE_NORTHING + - False_Easting: EPSG_NAME_PARAMETER_EASTING_PROJECTION_CENTRE + - False_Northing: EPSG_NAME_PARAMETER_NORTHING_PROJECTION_CENTRE - Scale_Factor: EPSG_NAME_PARAMETER_SCALE_FACTOR_PROJECTION_CENTRE - Azimuth: EPSG_NAME_PARAMETER_AZIMUTH_PROJECTION_CENTRE - - Longitude_Of_Center: EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN - - Latitude_Of_Center: EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN + - Longitude_Of_Center: EPSG_NAME_PARAMETER_LONGITUDE_PROJECTION_CENTRE + - Latitude_Of_Center: EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE - Winkel_Tripel: WKT2_name: "Winkel Tripel" diff --git a/src/iso19111/operation/esriparammappings.cpp b/src/iso19111/operation/esriparammappings.cpp index 9e5e33c725..415828c5e0 100644 --- a/src/iso19111/operation/esriparammappings.cpp +++ b/src/iso19111/operation/esriparammappings.cpp @@ -611,18 +611,18 @@ static const ESRIParamMapping paramsESRI_Orthographic[] = { {nullptr, nullptr, 0, "0.0", false}}; static const ESRIParamMapping paramsESRI_Local[] = { - {"False_Easting", EPSG_NAME_PARAMETER_FALSE_EASTING, - EPSG_CODE_PARAMETER_FALSE_EASTING, "0.0", false}, - {"False_Northing", EPSG_NAME_PARAMETER_FALSE_NORTHING, - EPSG_CODE_PARAMETER_FALSE_NORTHING, "0.0", false}, + {"False_Easting", EPSG_NAME_PARAMETER_EASTING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_EASTING_PROJECTION_CENTRE, "0.0", false}, + {"False_Northing", EPSG_NAME_PARAMETER_NORTHING_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_NORTHING_PROJECTION_CENTRE, "0.0", false}, {"Scale_Factor", EPSG_NAME_PARAMETER_SCALE_FACTOR_PROJECTION_CENTRE, - EPSG_CODE_PARAMETER_SCALE_FACTOR_PROJECTION_CENTRE, "1.0", false}, + EPSG_CODE_PARAMETER_SCALE_FACTOR_PROJECTION_CENTRE, "0.0", false}, {"Azimuth", EPSG_NAME_PARAMETER_AZIMUTH_PROJECTION_CENTRE, EPSG_CODE_PARAMETER_AZIMUTH_PROJECTION_CENTRE, "0.0", false}, - {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, - EPSG_CODE_PARAMETER_LONGITUDE_OF_NATURAL_ORIGIN, "0.0", false}, - {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, - EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN, "0.0", false}, + {"Longitude_Of_Center", EPSG_NAME_PARAMETER_LONGITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LONGITUDE_PROJECTION_CENTRE, "0.0", false}, + {"Latitude_Of_Center", EPSG_NAME_PARAMETER_LATITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LATITUDE_PROJECTION_CENTRE, "0.0", false}, {nullptr, nullptr, 0, "0.0", false}}; static const ESRIParamMapping paramsESRI_Winkel_Tripel[] = { @@ -1052,8 +1052,8 @@ static const ESRIMethodMapping esriMappings[] = { EPSG_NAME_METHOD_POLAR_STEREOGRAPHIC_VARIANT_A, EPSG_CODE_METHOD_POLAR_STEREOGRAPHIC_VARIANT_A, paramsESRI_Polar_Stereographic_Variant_A}, - {"Equidistant_Conic", PROJ_WKT2_NAME_METHOD_EQUIDISTANT_CONIC, 0, - paramsESRI_Equidistant_Conic}, + {"Equidistant_Conic", EPSG_NAME_METHOD_EQUIDISTANT_CONIC, + EPSG_CODE_METHOD_EQUIDISTANT_CONIC, 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, diff --git a/src/iso19111/operation/parammappings.cpp b/src/iso19111/operation/parammappings.cpp index 1cdccfcd5a..21560c3d70 100644 --- a/src/iso19111/operation/parammappings.cpp +++ b/src/iso19111/operation/parammappings.cpp @@ -367,24 +367,24 @@ static const ParamMapping *const paramsHomTwoPoint[] = { ¶mFalseNorthingProjectionCentre, nullptr}; -static const ParamMapping *const paramsNatOriginAzimuthScale[] = { - ¶mLatitudeNatOrigin, - ¶mLongitudeNatOrigin, - ¶mAzimuth, - ¶mScaleFactorProjectionCentre, - ¶mFalseEasting, - ¶mFalseNorthing, - nullptr}; - static const ParamMapping *const paramsIMWP[] = { ¶mLongitudeNatOrigin, ¶mLatFirstPoint, ¶mLatSecondPoint, ¶mFalseEasting, ¶mFalseNorthing, nullptr}; -static const ParamMapping paramLongCentreLongCenter = { - EPSG_NAME_PARAMETER_LONGITUDE_OF_ORIGIN, - EPSG_CODE_PARAMETER_LONGITUDE_OF_ORIGIN, WKT1_LONGITUDE_OF_CENTER, +static const ParamMapping paramLongCentre = { + EPSG_NAME_PARAMETER_LONGITUDE_PROJECTION_CENTRE, + EPSG_CODE_PARAMETER_LONGITUDE_PROJECTION_CENTRE, WKT1_LONGITUDE_OF_CENTER, common::UnitOfMeasure::Type::ANGULAR, lon_0}; +static const ParamMapping *const paramsLocalOrthographic[] = { + ¶mLatCentreLatCenter, + ¶mLongCentre, + ¶mAzimuth, + ¶mScaleFactorProjectionCentre, + ¶mFalseEastingProjectionCentre, + ¶mFalseNorthingProjectionCentre, + nullptr}; + static const ParamMapping paramColatitudeConeAxis = { EPSG_NAME_PARAMETER_COLATITUDE_CONE_AXIS, EPSG_CODE_PARAMETER_COLATITUDE_CONE_AXIS, WKT1_AZIMUTH, @@ -403,6 +403,11 @@ static const ParamMapping paramScaleFactorPseudoStdParallel = { WKT1_SCALE_FACTOR, common::UnitOfMeasure::Type::SCALE, k}; /* ignored by PROJ currently */ +static const ParamMapping paramLongCentreLongCenter = { + 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 *const krovakParameters[] = { ¶mLatCentreLatCenter, ¶mLongCentreLongCenter, @@ -500,11 +505,6 @@ static const ParamMapping *const paramsLoxim[] = { ¶mLatLoxim, ¶mLongitudeNatOrigin, ¶mFalseEasting, ¶mFalseNorthing, nullptr}; -static const ParamMapping paramLongCentre = { - EPSG_NAME_PARAMETER_LONGITUDE_PROJECTION_CENTRE, - EPSG_CODE_PARAMETER_LONGITUDE_PROJECTION_CENTRE, WKT1_LONGITUDE_OF_CENTER, - common::UnitOfMeasure::Type::ANGULAR, lon_0}; - static const ParamMapping paramLabordeObliqueMercatorAzimuth = { EPSG_NAME_PARAMETER_AZIMUTH_PROJECTION_CENTRE, EPSG_CODE_PARAMETER_AZIMUTH_PROJECTION_CENTRE, WKT1_AZIMUTH, @@ -832,7 +832,7 @@ static const MethodMapping projectionMethodMappings[] = { "Orthographic", "ortho", nullptr, paramsNatOrigin}, {EPSG_NAME_METHOD_LOCAL_ORTHOGRAPHIC, EPSG_CODE_METHOD_LOCAL_ORTHOGRAPHIC, - "Local Orthographic", "ortho", nullptr, paramsNatOriginAzimuthScale}, + "Local Orthographic", "ortho", nullptr, paramsLocalOrthographic}, {PROJ_WKT2_NAME_ORTHOGRAPHIC_SPHERICAL, 0, "Orthographic", "ortho", "f=0", paramsNatOrigin}, diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 8e87588a6a..afe1eba627 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -7415,12 +7415,12 @@ static const struct { {"Latitude_Of_Center", 4}}, "Local Orthographic", { - {"Latitude of natural origin", 4}, - {"Longitude of natural origin", 3}, + {"Latitude of projection centre", 4}, + {"Longitude of projection centre", 3}, {"Azimuth at projection centre", 15}, {"Scale factor at projection centre", 1.25}, - {"False easting", 1}, - {"False northing", 2}, + {"Easting at projection centre", 1}, + {"Northing at projection centre", 2}, }}, {"Winkel_Tripel", diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index a5db6687f7..59cf912595 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -3620,31 +3620,31 @@ TEST(operation, local_orthographic_export) { "CONVERSION[\"Local Orthographic\",\n" " METHOD[\"Local Orthographic\",\n" " ID[\"EPSG\",1130]],\n" - " PARAMETER[\"Latitude of natural origin\",1,\n" + " PARAMETER[\"Latitude of projection centre\",1,\n" " ANGLEUNIT[\"degree\",0.0174532925199433],\n" - " ID[\"EPSG\",8801]],\n" - " PARAMETER[\"Longitude of natural origin\",2,\n" + " ID[\"EPSG\",8811]],\n" + " PARAMETER[\"Longitude of projection centre\",2,\n" " ANGLEUNIT[\"degree\",0.0174532925199433],\n" - " ID[\"EPSG\",8802]],\n" + " ID[\"EPSG\",8812]],\n" " PARAMETER[\"Azimuth at projection centre\",3,\n" " ANGLEUNIT[\"degree\",0.0174532925199433],\n" " ID[\"EPSG\",8813]],\n" " PARAMETER[\"Scale factor at projection centre\",1.25,\n" " SCALEUNIT[\"unity\",1],\n" " ID[\"EPSG\",8815]],\n" - " PARAMETER[\"False easting\",4,\n" + " PARAMETER[\"Easting at projection centre\",4,\n" " LENGTHUNIT[\"metre\",1],\n" - " ID[\"EPSG\",8806]],\n" - " PARAMETER[\"False northing\",5,\n" + " ID[\"EPSG\",8816]],\n" + " PARAMETER[\"Northing at projection centre\",5,\n" " LENGTHUNIT[\"metre\",1],\n" - " ID[\"EPSG\",8807]]]"); + " ID[\"EPSG\",8817]]]"); EXPECT_EQ( conv->exportToWKT( WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL).get()), "PROJECTION[\"Local Orthographic\"],\n" - "PARAMETER[\"latitude_of_origin\",1],\n" - "PARAMETER[\"central_meridian\",2],\n" + "PARAMETER[\"latitude_of_center\",1],\n" + "PARAMETER[\"longitude_of_center\",2],\n" "PARAMETER[\"azimuth\",3],\n" "PARAMETER[\"scale_factor\",1.25],\n" "PARAMETER[\"false_easting\",4],\n"