<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div>
<div dir="ltr">
<div dir="ltr">You can edit your proj.db to have a more appropriate extent for the CRS so that it applies to points outside of it right now. I use sqlitebrowser to poke around proj.db. I would create a new extent with the enlarged rectangle, and then change
 CVGD28 to use that extent. You may have to make a copy of the vertical_crs, usage, and datum rows of the CRS as well. So like a whole new set of rows with EPSG:5713_ENLARGED.<span></span></div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Then just make sure your PROJ_DATA points to your modified proj.db and you can use EPSG:5713_ENLARGED instead. In the mean time, maybe let the appropriate government agency know that they have too small an extent published in EPSG so that it
 can be revised in next release.<span></span></div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Sincerely, Erixen</div>
</div>
</div>
<div id="ms-outlook-mobile-signature">
<div></div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> PROJ <proj-bounces@lists.osgeo.org> on behalf of Javier Jimenez Shaw via PROJ <proj@lists.osgeo.org><br>
<b>Sent:</b> Thursday, December 21, 2023 4:48:30 AM<br>
<b>To:</b> proj <PROJ@lists.osgeo.org><br>
<b>Subject:</b> Re: [PROJ] Problems with CGVD28 height</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Using the option "--bbox", if I have done correctly, I get this</div>
<div><br>
</div>
<div><span>PROJ_NETWORK=ON projinfo -s EPSG:4979 -t EPSG:32181+5713 -o proj --spatial-test intersects --bbox '-53.6,47.7,-53.5,47.8'
<br>
Candidate operations found: 2<br>
-------------------------------------<br>
Operation No. 1:<br>
<br>
unknown id, Inverse of Transformation from CGVD28 height to WGS 84 (ballpark vertical transformation, without ellipsoid height to vertical height correction) + Inverse of NAD83 to WGS 84 (1) + MTM zone 1, unknown accuracy, North America - onshore and offshore:
 Canada - Alberta; British Columbia; Manitoba; New Brunswick; Newfoundland and Labrador; Northwest Territories; Nova Scotia; Nunavut; Ontario; Prince Edward Island; Quebec; Saskatchewan; Yukon. United States (USA) - Alabama; Alaska (mainland); Arizona; Arkansas;
 California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New
 Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming., has ballpark transformation<br>
<br>
PROJ string:<br>
+proj=pipeline<br>
  +step +proj=axisswap +order=2,1<br>
  +step +proj=unitconvert +xy_in=deg +xy_out=rad<br>
  +step +proj=tmerc +lat_0=0 +lon_0=-53 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80</span></div>
<div><span><br>
</span></div>
<div><span>I could imagine that the reason is that the bbox does not intersect with the area of use of
</span><span>CGVD28 heigh (despite of the geoid model file covers that point). Is there a way to workaround it?</span></div>
<div><span><br>
</span></div>
<div><span>Thanks<br>
</span></div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Thu, 21 Dec 2023 at 10:27, Javier Jimenez Shaw <<a href="mailto:j1@jimenezshaw.com" target="_blank">j1@jimenezshaw.com</a>> wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div>Hi</div>
<div><br>
</div>
<div>I'm trying to convert from WGS84 (or NAD83, I do not mind)  to "MTM zone 1 + CGVD28 height" in Canada.</div>
<div>I know that the area of use of "MTM zone 1" and "CGVD28 height" do not intersect. But they told me "<span>Canadian agencies still require this datum [</span>CGVD28]
<span>throughout all of Canada." Actually the geoid model grid file [</span>ca_nrc_HT2_1997.tif: Canada, Natural Resources Canada, NAD83(CSRS)v2 (EPSG:8235) to CGVD28 height (EPSG:5713)]<span> covers much more than the CRS area of use.</span></div>
<div><br>
</div>
projinfo says something that makes sense to me:<br>
<div>
<div><br>
</div>
<div>PROJ_NETWORK=ON projinfo -s EPSG:4979 -t EPSG:32181+5713 -o proj --spatial-test intersects</div>
<div><br>
</div>
<div>Candidate operations found: 303<br>
-------------------------------------<br>
Operation No. 1:<br>
<br>
unknown id, Inverse of NAD83 to WGS 84 (6) + NAD83 to NAD83(CSRS)v2 (1) + NAD83(CSRS)v2 to CGVD28 height (1) + Inverse of NAD83 to NAD83(CSRS)v2 (1) + MTM zone 1, 4.55 m, unknown domain of validity<br>
<br>
PROJ string:<br>
+proj=pipeline<br>
  +step +proj=axisswap +order=2,1<br>
  +step +proj=unitconvert +xy_in=deg +xy_out=rad<br>
  +step +inv +proj=vgridshift +grids=ca_nrc_HT2_1997.tif +multiplier=1<br>
  +step +inv +proj=hgridshift +grids=ca_nrc_NA83SCRS.tif<br>
  +step +proj=tmerc +lat_0=0 +lon_0=-53 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80</div>
<div><br>
</div>
<div>But cs2cs is not doing any vertical transformation:<br>
</div>
<div><br>
</div>
<div>
<div>echo 47.741422 -53.613219 0 | PROJ_NETWORK=ON cs2cs EPSG:4979 EPSG:32181+5713 --3d<br>
258814.79 5289330.04 0.00</div>
<div><br>
</div>
<div>Running with PROJ_DEBUG=3 it ends with</div>
<div>Using coordinate operation Inverse of Transformation from CGVD28 height to WGS 84 (ballpark vertical transformation, without ellipsoid height to vertical height correction) + Inverse of Ballpark geographic offset from NAD83 to WGS 84 + MTM zone 1</div>
<div>that makes sense with the no-change in elevation.</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div>Why is that happening?</div>
<div><br>
</div>
<div>I do not care so much about the version of NAD83. I tried with some and I get the same result.</div>
<div>The same with the source CRS. I use WGS84, but can be any flavour of NAD83.</div>
<div><br>
</div>
<div>Thanks.<br>
</div>
<div>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div></div>
<div>.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>