Re: Bug reading a byn file for Canadian geoid model?
Javier Jimenez Shaw via gdal-dev <[email protected]> Wed, 15 Jul 2026 20:02:55 +0200
| Newsgroups | gmane.comp.gis.gdal.devel |
|---|---|
| Message-ID | <CADRrdKttemdpJxCV6GgXjhynRdJdSq+h3r4nM4S89KevNrnxwg@mail.gmail.com> |
--===============8771317698298617233== Content-Type: multipart/alternative; boundary="000000000000c24fa50656aa2208" --000000000000c24fa50656aa2208 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I started a branch to fix it. Looks like there enough info in the byn header. On Wed, 15 Jul 2026, 20:00 Even Rouault, <[email protected]> wrote= : > Javier, > > I'd assume that code that assigns datums to have only been valid for the > particular grids it was developped for. You'd better ignore any CRS > information reported by the driver and override them from the > documentation of the grid you're interested in > > Even > > Le 09/07/2026 =C3=A0 17:20, Javier Jimenez Shaw via gdal-dev a =C3=A9crit= : > > Hi > > > > I am trying to read this file, in theory based in ITRF > > > https://webapp.csrs-scrs.nrcan-rncan.gc.ca/geod/process/download-helper.p= hp?file_id=3DGSD95 > > (there is another one based in NAD83xxx) > > > > However in with gdalinfo I see this: > > "Warning 1: CRS EPSG:4140 is deprecated. Its non-deprecated > > replacement EPSG:4617 will be used instead. To use the original CRS, > > set the OSR_USE_NON_DEPRECATED configuration option to NO." > > > > EPSG:4140 https://spatialreference.org/ref/epsg/4140/ > > is NAD83(CSRS98), that is not ITRF, as far as I know. > > > > However in byndataset.h there is this line: > > > > constexpr int BYN_DATUM_0 =3D 4140; /* ITRF2008 (GRS80 based WGS84) */ > > > > https://github.com/OSGeo/gdal/blob/master/frmts/raw/byndataset.h#L168 > > > > Are we parsing the header wrongly? > > > > There is some documentation in > > > https://webapp.csrs-scrs.nrcan-rncan.gc.ca/geod/tools-outils/sample_doc_f= iles/NRCan_Geoid_GridFormat_EN_2023.pdf > > I think what I say above applies to the field 16, Datum. > > > > Thanks > > Javier > > > > _______________________________________________ > > gdal-dev mailing list > > [email protected] > > https://lists.osgeo.org/mailman/listinfo/gdal-dev > > -- > http://www.spatialys.com > My software is free, but my time generally not. > LLMs contribute to global warming and brain rot. > > --000000000000c24fa50656aa2208 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">I started a branch to fix it. Looks like there enough inf= o in the byn header.</div><br><div class=3D"gmail_quote gmail_quote_contain= er"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, 15 Jul 2026, 20:00 Even R= ouault, <<a href=3D"mailto:[email protected]">even.rouault@spat= ialys.com</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style= =3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding= -left:1ex">Javier,<br> <br> I'd assume that code that assigns datums to have only been valid for th= e <br> particular grids it was developped for. You'd better ignore any CRS <br= > information reported by the driver and override them from the <br> documentation of the grid you're interested in<br> <br> Even<br> <br> Le 09/07/2026 =C3=A0 17:20, Javier Jimenez Shaw via gdal-dev a =C3=A9crit= =C2=A0:<br> > Hi<br> ><br> > I am trying to read this file, in theory based in ITRF<br> > <a href=3D"https://webapp.csrs-scrs.nrcan-rncan.gc.ca/geod/process/dow= nload-helper.php?file_id=3DGSD95" rel=3D"noreferrer noreferrer" target=3D"_= blank">https://webapp.csrs-scrs.nrcan-rncan.gc.ca/geod/process/download-hel= per.php?file_id=3DGSD95</a><br> > (there is another one based in NAD83xxx)<br> ><br> > However in with gdalinfo I see this:<br> > "Warning 1: CRS EPSG:4140 is deprecated. Its non-deprecated <br> > replacement EPSG:4617 will be used instead. To use the original CRS, <= br> > set the OSR_USE_NON_DEPRECATED configuration option to NO."<br> ><br> > EPSG:4140 <a href=3D"https://spatialreference.org/ref/epsg/4140/" rel= =3D"noreferrer noreferrer" target=3D"_blank">https://spatialreference.org/r= ef/epsg/4140/</a> <br> > is=C2=A0NAD83(CSRS98), that is not ITRF, as far as I know.<br> ><br> > However in byndataset.h there is this line:<br> ><br> > constexpr int BYN_DATUM_0 =3D 4140; =C2=A0/* ITRF2008 (GRS80 based WGS= 84) */<br> ><br> > <a href=3D"https://github.com/OSGeo/gdal/blob/master/frmts/raw/byndata= set.h#L168" rel=3D"noreferrer noreferrer" target=3D"_blank">https://github.= com/OSGeo/gdal/blob/master/frmts/raw/byndataset.h#L168</a><br> ><br> > Are we parsing the header wrongly?<br> ><br> > There is some documentation in <br> > <a href=3D"https://webapp.csrs-scrs.nrcan-rncan.gc.ca/geod/tools-outil= s/sample_doc_files/NRCan_Geoid_GridFormat_EN_2023.pdf" rel=3D"noreferrer no= referrer" target=3D"_blank">https://webapp.csrs-scrs.nrcan-rncan.gc.ca/geod= /tools-outils/sample_doc_files/NRCan_Geoid_GridFormat_EN_2023.pdf</a><br> > I think what I say above applies to the field 16, Datum.<br> ><br> > Thanks<br> > Javier<br> ><br> > _______________________________________________<br> > gdal-dev mailing list<br> > <a href=3D"mailto:[email protected]" target=3D"_blank" rel=3D"n= oreferrer">[email protected]</a><br> > <a href=3D"https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel=3D"n= oreferrer noreferrer" target=3D"_blank">https://lists.osgeo.org/mailman/lis= tinfo/gdal-dev</a><br> <br> -- <br> <a href=3D"http://www.spatialys.com" rel=3D"noreferrer noreferrer" target= =3D"_blank">http://www.spatialys.com</a><br> My software is free, but my time generally not.<br> LLMs contribute to global warming and brain rot.<br> <br> </blockquote></div> --000000000000c24fa50656aa2208-- --===============8771317698298617233== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev --===============8771317698298617233==--