@@ -7307,6 +7307,7 @@ TEST(wkt_parse, wkt1_esri_normalize_unit) {
7307
7307
// ---------------------------------------------------------------------------
7308
7308
7309
7309
TEST(wkt_parse, wkt1_esri_ups_north) {
7310
+ // EPSG:32661
7310
7311
auto wkt = "PROJCS[\"UPS_North\",GEOGCS[\"GCS_WGS_1984\","
7311
7312
"DATUM[\"D_WGS_1984\","
7312
7313
"SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],"
@@ -7319,9 +7320,8 @@ TEST(wkt_parse, wkt1_esri_ups_north) {
7319
7320
"PARAMETER[\"Latitude_Of_Origin\",90.0],"
7320
7321
"UNIT[\"Meter\",1.0]]";
7321
7322
7322
- auto obj = WKTParser()
7323
- .attachDatabaseContext(DatabaseContext::create())
7324
- .createFromWKT(wkt);
7323
+ auto dbContext = DatabaseContext::create();
7324
+ auto obj = WKTParser().attachDatabaseContext(dbContext).createFromWKT(wkt);
7325
7325
auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
7326
7326
ASSERT_TRUE(crs != nullptr);
7327
7327
@@ -7334,11 +7334,18 @@ TEST(wkt_parse, wkt1_esri_ups_north) {
7334
7334
EXPECT_EQ(crs->coordinateSystem()->axisList()[1]->direction(),
7335
7335
AxisDirection::SOUTH);
7336
7336
EXPECT_EQ(crs->coordinateSystem()->axisList()[1]->abbreviation(), "N");
7337
+
7338
+ EXPECT_EQ(
7339
+ crs->exportToWKT(
7340
+ WKTFormatter::create(WKTFormatter::Convention::WKT1_ESRI, dbContext)
7341
+ .get()),
7342
+ wkt);
7337
7343
}
7338
7344
7339
7345
// ---------------------------------------------------------------------------
7340
7346
7341
7347
TEST(wkt_parse, wkt1_esri_ups_south) {
7348
+ // EPSG:32671
7342
7349
auto wkt = "PROJCS[\"UPS_South\",GEOGCS[\"GCS_WGS_1984\","
7343
7350
"DATUM[\"D_WGS_1984\","
7344
7351
"SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],"
@@ -7351,9 +7358,8 @@ TEST(wkt_parse, wkt1_esri_ups_south) {
7351
7358
"PARAMETER[\"Latitude_Of_Origin\",-90.0],"
7352
7359
"UNIT[\"Meter\",1.0]]";
7353
7360
7354
- auto obj = WKTParser()
7355
- .attachDatabaseContext(DatabaseContext::create())
7356
- .createFromWKT(wkt);
7361
+ auto dbContext = DatabaseContext::create();
7362
+ auto obj = WKTParser().attachDatabaseContext(dbContext).createFromWKT(wkt);
7357
7363
auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
7358
7364
ASSERT_TRUE(crs != nullptr);
7359
7365
@@ -7366,6 +7372,86 @@ TEST(wkt_parse, wkt1_esri_ups_south) {
7366
7372
EXPECT_EQ(crs->coordinateSystem()->axisList()[1]->direction(),
7367
7373
AxisDirection::NORTH);
7368
7374
EXPECT_EQ(crs->coordinateSystem()->axisList()[1]->abbreviation(), "N");
7375
+
7376
+ EXPECT_EQ(
7377
+ crs->exportToWKT(
7378
+ WKTFormatter::create(WKTFormatter::Convention::WKT1_ESRI, dbContext)
7379
+ .get()),
7380
+ wkt);
7381
+ }
7382
+
7383
+ // ---------------------------------------------------------------------------
7384
+
7385
+ TEST(wkt_parse, wkt1_esri_wgs_1984_ups_north_E_N) {
7386
+ // EPSG:5041
7387
+ auto wkt = "PROJCS[\"WGS_1984_UPS_North_(E-N)\","
7388
+ "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\","
7389
+ "SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],"
7390
+ "PRIMEM[\"Greenwich\",0.0],"
7391
+ "UNIT[\"Degree\",0.0174532925199433]],"
7392
+ "PROJECTION[\"Polar_Stereographic_Variant_A\"],"
7393
+ "PARAMETER[\"False_Easting\",2000000.0],"
7394
+ "PARAMETER[\"False_Northing\",2000000.0],"
7395
+ "PARAMETER[\"Central_Meridian\",0.0],"
7396
+ "PARAMETER[\"Scale_Factor\",0.994],"
7397
+ "PARAMETER[\"Latitude_Of_Origin\",90.0],"
7398
+ "UNIT[\"Meter\",1.0]]";
7399
+
7400
+ auto dbContext = DatabaseContext::create();
7401
+ auto obj = WKTParser().attachDatabaseContext(dbContext).createFromWKT(wkt);
7402
+ auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
7403
+ ASSERT_TRUE(crs != nullptr);
7404
+
7405
+ EXPECT_EQ(crs->nameStr(), "WGS 84 / UPS North (E,N)");
7406
+ EXPECT_EQ(crs->coordinateSystem()->axisList()[0]->direction(),
7407
+ AxisDirection::SOUTH);
7408
+ EXPECT_EQ(crs->coordinateSystem()->axisList()[0]->abbreviation(), "E");
7409
+ EXPECT_EQ(crs->coordinateSystem()->axisList()[1]->direction(),
7410
+ AxisDirection::SOUTH);
7411
+ EXPECT_EQ(crs->coordinateSystem()->axisList()[1]->abbreviation(), "N");
7412
+
7413
+ EXPECT_EQ(
7414
+ crs->exportToWKT(
7415
+ WKTFormatter::create(WKTFormatter::Convention::WKT1_ESRI, dbContext)
7416
+ .get()),
7417
+ wkt);
7418
+ }
7419
+
7420
+ // ---------------------------------------------------------------------------
7421
+
7422
+ TEST(wkt_parse, wkt1_esri_wgs_1984_ups_south_E_N) {
7423
+ // EPSG:5042
7424
+ auto wkt = "PROJCS[\"WGS_1984_UPS_South_(E-N)\","
7425
+ "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\","
7426
+ "SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],"
7427
+ "PRIMEM[\"Greenwich\",0.0],"
7428
+ "UNIT[\"Degree\",0.0174532925199433]],"
7429
+ "PROJECTION[\"Polar_Stereographic_Variant_A\"],"
7430
+ "PARAMETER[\"False_Easting\",2000000.0],"
7431
+ "PARAMETER[\"False_Northing\",2000000.0],"
7432
+ "PARAMETER[\"Central_Meridian\",0.0],"
7433
+ "PARAMETER[\"Scale_Factor\",0.994],"
7434
+ "PARAMETER[\"Latitude_Of_Origin\",-90.0],"
7435
+ "UNIT[\"Meter\",1.0]]";
7436
+
7437
+ auto dbContext = DatabaseContext::create();
7438
+ auto obj = WKTParser().attachDatabaseContext(dbContext).createFromWKT(wkt);
7439
+ auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
7440
+ ASSERT_TRUE(crs != nullptr);
7441
+
7442
+ EXPECT_EQ(crs->nameStr(), "WGS 84 / UPS South (E,N)");
7443
+ EXPECT_EQ(crs->coordinateSystem()->axisList()[0]->direction(),
7444
+ AxisDirection::NORTH);
7445
+ EXPECT_EQ(crs->coordinateSystem()->axisList()[0]->abbreviation(), "E");
7446
+ EXPECT_EQ(crs->coordinateSystem()->axisList()[1]->direction(),
7447
+ AxisDirection::NORTH);
7448
+ EXPECT_EQ(crs->coordinateSystem()->axisList()[1]->abbreviation(), "N");
7449
+
7450
+ EXPECT_EQ(
7451
+ crs->exportToWKT(
7452
+ WKTFormatter::create(WKTFormatter::Convention::WKT1_ESRI, dbContext)
7453
+ .get()),
7454
+ wkt);
7369
7455
}
7370
7456
7371
7457
// ---------------------------------------------------------------------------
0 commit comments