Skip to content

Commit

Permalink
test for operation with compound with derived projected
Browse files Browse the repository at this point in the history
  • Loading branch information
jjimenezshaw committed Aug 9, 2022
1 parent 2e40178 commit 14cb8ad
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions test/unit/test_operationfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8473,3 +8473,70 @@ TEST(operation, createOperation_derived_projected_crs) {
"+step +proj=affine +xoff=20 "
"+step +proj=axisswap +order=2,1");
}

TEST(operation,
geogCRS_to_compoundCRS_with_boundVerticalCRS_and_derivedProjected) {
auto wkt =
"DERIVEDPROJCRS[\"Custom Site Calibrated CRS\",\n"
" BASEPROJCRS[\"NAD83(2011) / Mississippi East (ftUS)\",\n"
" BASEGEOGCRS[\"NAD83(2011)\",\n"
" DATUM[\"NAD83 (National Spatial Reference System "
"2011)\",\n"
" ELLIPSOID[\"GRS 1980\",6378137,298.257222101,\n"
" LENGTHUNIT[\"metre\",1]]],\n"
" PRIMEM[\"Greenwich\",0,\n"
" ANGLEUNIT[\"degree\",0.0174532925199433]]],\n"
" CONVERSION[\"SPCS83 Mississippi East zone (US Survey "
"feet)\",\n"
" METHOD[\"Transverse Mercator\",\n"
" ID[\"EPSG\",9807]],\n"
" PARAMETER[\"Latitude of natural origin\",29.5,\n"
" ANGLEUNIT[\"degree\",0.0174532925199433],\n"
" ID[\"EPSG\",8801]],\n"
" PARAMETER[\"Longitude of natural "
"origin\",-88.8333333333333,\n"
" ANGLEUNIT[\"degree\",0.0174532925199433],\n"
" ID[\"EPSG\",8802]],\n"
" PARAMETER[\"Scale factor at natural origin\",0.99995,\n"
" SCALEUNIT[\"unity\",1],\n"
" ID[\"EPSG\",8805]],\n"
" PARAMETER[\"False easting\",984250,\n"
" LENGTHUNIT[\"US survey foot\",0.304800609601219],\n"
" ID[\"EPSG\",8806]],\n"
" PARAMETER[\"False northing\",0,\n"
" LENGTHUNIT[\"US survey foot\",0.304800609601219],\n"
" ID[\"EPSG\",8807]]]],\n"
" DERIVINGCONVERSION[\"Affine transformation as PROJ-based\",\n"
" METHOD[\"PROJ-based operation method: "
"+proj=pipeline +step +proj=unitconvert +xy_in=m +xy_out=us-ft "
"+step +proj=affine +xoff=20 "
"+step +proj=unitconvert +xy_in=us-ft +xy_out=m\"]],\n"
" CS[Cartesian,2],\n"
" AXIS[\"northing (Y)\",north,\n"
" LENGTHUNIT[\"US survey foot\",0.304800609601219]],\n"
" AXIS[\"easting (X)\",east,\n"
" LENGTHUNIT[\"US survey foot\",0.304800609601219]],\n"
" REMARK[\"EPSG:6507 with 20 feet offset and axis inversion\"]]";
auto objDst = WKTParser().createFromWKT(wkt);
auto dst = nn_dynamic_pointer_cast<CRS>(objDst);
ASSERT_TRUE(dst != nullptr);

auto compound = CompoundCRS::create(
PropertyMap(),
std::vector<CRSNNPtr>{NN_NO_CHECK(dst), createBoundVerticalCRS()});
auto op = CoordinateOperationFactory::create()->createOperation(
GeographicCRS::EPSG_4979, compound);
ASSERT_TRUE(op != nullptr);
EXPECT_EQ(
op->exportToPROJString(PROJStringFormatter::create().get()),
"+proj=pipeline "
"+step +proj=axisswap +order=2,1 "
"+step +proj=unitconvert +xy_in=deg +xy_out=rad "
"+step +inv +proj=vgridshift +grids=us_nga_egm08_25.tif "
"+multiplier=1 "
"+step +proj=tmerc +lat_0=29.5 +lon_0=-88.8333333333333 "
"+k=0.99995 +x_0=300000 +y_0=0 +ellps=GRS80 "
"+step +proj=unitconvert +xy_in=m +xy_out=us-ft "
"+step +proj=affine +xoff=20 "
"+step +proj=axisswap +order=2,1");
}

0 comments on commit 14cb8ad

Please sign in to comment.