-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect conversion from ETRS89 to OSGB36+ODN with OSGM15 geoid #2173
Comments
I've also tried modifying the SQL table grid_alternatives adding this to
After doing this, the output of
But
still outputs I'm trying to feed that PROJ string to
|
Instead of hacking the EPSG:7405 definition, you probably just need to add an entry in data/sql/grid_alternatives.sql to map the EPSG "official" name 'OSTN15_OSGM15_GB.txt' to your grid. And if it works and the grid can be licensed under the ones we can accept, it would be more than welcome!
Change from projected to geographic + datum shifts will probably cause some "artefacts" that can explain you will not get exactly the reference output, but that's probably acceptable. Care should be done to having the horizontal shift OSGB36->ETRS89 right when reprojecting the grid. |
That looks very good !
Hum, strange. Try setting PROJ_DEBUG=3 to have verbose details
Pipelines can't work with the proj ancient utility. Use cct instead
|
Nice, it worked with Regarding the grid, I will try to produce it using GDAL. Assuming that I'm resampling the original data from a projected CRS into a geographic one and that the interpolation is bilinear, having mm errors is totally acceptable in my opinion. Strictly speaking, the question is how much does my grid differ from the original data at the benchmark positions of the ODN network, but I have neither the knowledge nor the time to do that analysis. On the other hand, making sure that the resampling is using the correct horizontal grid is a very good point, because that could introduce some additional mm of error that is totally avoidable and I don't know what QGIS did in that regard. |
I naively thought I could attach a file... Here you are: https://gist.github.com/hernando/af03ca08de428baaab1399ca73a248fd#file-cs2c2_debug_output |
The log is interesting since at the end it mentions "Using coordinate operation Inverse of Transformation from ODN height to ETRS89 (ballpark vertical transformation, without ellipsoid height to vertical height correction) + Inverse of OSGB 1936 to ETRS89 (2) + British National Grid", so it ignores the vertical grid, but earlier in it, it successfully opens the vertical grid. I'd suspect maybe something related to the area of use of the transformation.
"gdalwarp -r bilinear -s_srs EPSG:27700 -t_srs EPSG:4258 ..." should do the job (assuming the projected grid is in EPSG:27700), and use PROJ underneath to apply the horizontal shift grid. |
You nailed it! The coordinates So, if I do I guess you can close this ticket, thanks for the help. I will submit the PRs for the grid if I can. |
Note: pending pull request to add that grid in OSGeo/PROJ-data#25 |
I'm trying to get accurate conversions from ERTS89 (EPSG:4937) to OSG36B+ODN (EPSG:7405) using a geoid model grid that I derived myself from publicly available data (the grid is only 1.3 MB so I could share attach it if necessary). I will give details on how I created the grid later, but basically I followed the instructions of the the grid_tools from PROJ-data, the grid doesn't seem to be the problem anyway.
I'm using the test coordinates provided in the OS developer pack
Example of problem
I modified the WKT string for 7405 to include PROJ4_GRIDS in the vertical datum, then I used this string as input to
cs2cs
to test a few transformations.Problem description
The reference output for this transformation is 91492.146 11318.804 46.519.
The first transformation gets the horizontal part right, but the vertical component is not transformed. This is expected, as the file referred by
proj.db
for OSGM15 is not found (the file is OSTN15_OSGM15_GB.txt and I haven't found it anywhere, where does it come from?).In the second transformation the vertical transformation is almost perfect, but the horizontal transformation is ignoring the horizontal grid shift for ETRS89 to OSGB36.
The grid file I made was obtained by downloading a GeoTIFF from Agisoft which contains the same data as the OSTN15_OSGM15_DataFile.txt file from the OS Developers Pack but in a more convenient format. I used QGIS to resample the data and change the source CRS from the projected OSGB36 to ETRS89 (so it's geographic) and then I used
vertoffset_grid_to_gtiff.py
from the Docker imageosgeo/gdal:alpine-normal-latest
to convert it to the standard GeoTIFF expected by Proj.Expected Output
Environment Information
Installation method
The text was updated successfully, but these errors were encountered: