@@ -284,25 +284,52 @@ TEST(operation, geogCRS_to_geogCRS_context_inverse_needed) {
284284 authFactory->createCoordinateReferenceSystem("4275"), // NTF
285285 authFactory->createCoordinateReferenceSystem("4258"), // ETRS89
286286 ctxt);
287- ASSERT_EQ(list.size(), 2U);
288- EXPECT_EQ(
289- list[0]->exportToPROJString(PROJStringFormatter::create().get()),
290- "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
291- "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=push +v_3 "
292- "+step +proj=cart +ellps=clrk80ign +step +proj=helmert +x=-168 "
293- "+y=-60 +z=320 +step +inv +proj=cart +ellps=GRS80 +step +proj=pop "
294- "+v_3 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step "
295- "+proj=axisswap +order=2,1");
287+ ASSERT_EQ(list.size(), 3U);
288+
289+ EXPECT_EQ(list[0]->exportToPROJString(
290+ PROJStringFormatter::create(
291+ PROJStringFormatter::Convention::PROJ_5,
292+ authFactory->databaseContext())
293+ .get()),
294+ "+proj=pipeline "
295+ "+step +proj=axisswap +order=2,1 "
296+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
297+ "+step +proj=push +v_3 "
298+ "+step +proj=cart +ellps=clrk80ign "
299+ "+step +proj=helmert +x=-168 +y=-60 +z=320 "
300+ "+step +inv +proj=cart +ellps=GRS80 "
301+ "+step +proj=pop +v_3 "
302+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
303+ "+step +proj=axisswap +order=2,1");
304+
296305 EXPECT_EQ(list[1]->exportToPROJString(
297306 PROJStringFormatter::create(
298307 PROJStringFormatter::Convention::PROJ_5,
299308 authFactory->databaseContext())
300309 .get()),
301- "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
302- "+proj=unitconvert +xy_in=deg +xy_out=rad +step "
303- "+proj=hgridshift +grids=fr_ign_ntf_r93.tif +step "
304- "+proj=unitconvert "
305- "+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1");
310+ "+proj=pipeline "
311+ "+step +proj=axisswap +order=2,1 "
312+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
313+ "+step +proj=push +v_3 "
314+ "+step +proj=cart +ellps=clrk80ign "
315+ "+step +proj=xyzgridshift +grids=fr_ign_gr3df97a.tif "
316+ "+grid_ref=output_crs +ellps=GRS80 "
317+ "+step +inv +proj=cart +ellps=GRS80 "
318+ "+step +proj=pop +v_3 "
319+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
320+ "+step +proj=axisswap +order=2,1");
321+
322+ EXPECT_EQ(list[2]->exportToPROJString(
323+ PROJStringFormatter::create(
324+ PROJStringFormatter::Convention::PROJ_5,
325+ authFactory->databaseContext())
326+ .get()),
327+ "+proj=pipeline "
328+ "+step +proj=axisswap +order=2,1 "
329+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
330+ "+step +proj=hgridshift +grids=fr_ign_ntf_r93.tif "
331+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
332+ "+step +proj=axisswap +order=2,1");
306333 }
307334 {
308335 auto ctxt =
@@ -314,14 +341,51 @@ TEST(operation, geogCRS_to_geogCRS_context_inverse_needed) {
314341 authFactory->createCoordinateReferenceSystem("4275"), // NTF
315342 authFactory->createCoordinateReferenceSystem("4258"), // ETRS89
316343 ctxt);
317- ASSERT_EQ(list.size(), 2U);
318- EXPECT_EQ(
319- list[0]->exportToPROJString(PROJStringFormatter::create().get()),
320- "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
321- "+proj=unitconvert +xy_in=deg +xy_out=rad +step "
322- "+proj=hgridshift +grids=fr_ign_ntf_r93.tif +step "
323- "+proj=unitconvert "
324- "+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1");
344+ ASSERT_EQ(list.size(), 3U);
345+ EXPECT_EQ(list[0]->exportToPROJString(
346+ PROJStringFormatter::create(
347+ PROJStringFormatter::Convention::PROJ_5,
348+ authFactory->databaseContext())
349+ .get()),
350+ "+proj=pipeline "
351+ "+step +proj=axisswap +order=2,1 "
352+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
353+ "+step +proj=push +v_3 "
354+ "+step +proj=cart +ellps=clrk80ign "
355+ "+step +proj=xyzgridshift +grids=fr_ign_gr3df97a.tif "
356+ "+grid_ref=output_crs +ellps=GRS80 "
357+ "+step +inv +proj=cart +ellps=GRS80 "
358+ "+step +proj=pop +v_3 "
359+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
360+ "+step +proj=axisswap +order=2,1");
361+
362+ EXPECT_EQ(list[1]->exportToPROJString(
363+ PROJStringFormatter::create(
364+ PROJStringFormatter::Convention::PROJ_5,
365+ authFactory->databaseContext())
366+ .get()),
367+ "+proj=pipeline "
368+ "+step +proj=axisswap +order=2,1 "
369+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
370+ "+step +proj=hgridshift +grids=fr_ign_ntf_r93.tif "
371+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
372+ "+step +proj=axisswap +order=2,1");
373+
374+ EXPECT_EQ(list[2]->exportToPROJString(
375+ PROJStringFormatter::create(
376+ PROJStringFormatter::Convention::PROJ_5,
377+ authFactory->databaseContext())
378+ .get()),
379+ "+proj=pipeline "
380+ "+step +proj=axisswap +order=2,1 "
381+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
382+ "+step +proj=push +v_3 "
383+ "+step +proj=cart +ellps=clrk80ign "
384+ "+step +proj=helmert +x=-168 +y=-60 +z=320 "
385+ "+step +inv +proj=cart +ellps=GRS80 "
386+ "+step +proj=pop +v_3 "
387+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
388+ "+step +proj=axisswap +order=2,1");
325389 }
326390 {
327391 auto ctxt =
@@ -333,14 +397,51 @@ TEST(operation, geogCRS_to_geogCRS_context_inverse_needed) {
333397 authFactory->createCoordinateReferenceSystem("4258"), // ETRS89
334398 authFactory->createCoordinateReferenceSystem("4275"), // NTF
335399 ctxt);
336- ASSERT_EQ(list.size(), 2U);
337- EXPECT_EQ(
338- list[0]->exportToPROJString(PROJStringFormatter::create().get()),
339- "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
340- "+proj=unitconvert +xy_in=deg +xy_out=rad +step +inv "
341- "+proj=hgridshift +grids=fr_ign_ntf_r93.tif +step "
342- "+proj=unitconvert "
343- "+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1");
400+ ASSERT_EQ(list.size(), 3U);
401+ EXPECT_EQ(list[0]->exportToPROJString(
402+ PROJStringFormatter::create(
403+ PROJStringFormatter::Convention::PROJ_5,
404+ authFactory->databaseContext())
405+ .get()),
406+ "+proj=pipeline "
407+ "+step +proj=axisswap +order=2,1 "
408+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
409+ "+step +proj=push +v_3 "
410+ "+step +proj=cart +ellps=GRS80 "
411+ "+step +inv +proj=xyzgridshift +grids=fr_ign_gr3df97a.tif "
412+ "+grid_ref=output_crs +ellps=GRS80 "
413+ "+step +inv +proj=cart +ellps=clrk80ign "
414+ "+step +proj=pop +v_3 "
415+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
416+ "+step +proj=axisswap +order=2,1");
417+
418+ EXPECT_EQ(list[1]->exportToPROJString(
419+ PROJStringFormatter::create(
420+ PROJStringFormatter::Convention::PROJ_5,
421+ authFactory->databaseContext())
422+ .get()),
423+ "+proj=pipeline "
424+ "+step +proj=axisswap +order=2,1 "
425+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
426+ "+step +inv +proj=hgridshift +grids=fr_ign_ntf_r93.tif "
427+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
428+ "+step +proj=axisswap +order=2,1");
429+
430+ EXPECT_EQ(list[2]->exportToPROJString(
431+ PROJStringFormatter::create(
432+ PROJStringFormatter::Convention::PROJ_5,
433+ authFactory->databaseContext())
434+ .get()),
435+ "+proj=pipeline "
436+ "+step +proj=axisswap +order=2,1 "
437+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
438+ "+step +proj=push +v_3 "
439+ "+step +proj=cart +ellps=GRS80 "
440+ "+step +proj=helmert +x=168 +y=60 +z=-320 "
441+ "+step +inv +proj=cart +ellps=clrk80ign "
442+ "+step +proj=pop +v_3 "
443+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
444+ "+step +proj=axisswap +order=2,1");
344445 }
345446}
346447
0 commit comments