-
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
GeoTIF files for UK don't yield expected results when used in GDAL #2360
Comments
Sure you can perform the bilinar interpolation PROJ does with someling like
Output:
CC'ing @and-marsh in case he had remarks on how he deduced error of the reprojected grid from the original one |
I need something from the PROJ C/C++ api. The string is very useful though. Thanks for the quick reply. |
just study the source code of cct (src/apps/cct.cpp). It uses proj_create() + proj_trans() |
See https://proj.org/community/channels.html - the mailing list is the preferred option. As for the rest of your inquiry you seem to be well covered already. |
Thanks! I have my test program now as:
I get the same results as when I read the file myself so I am left to assume the data is not quite correct or there is still something wrong with the LAT/LON pair. I am assuming WGS84 as the coordinate. |
Thanks for info on the mailing list. Would you know if the file is accurate? I downloaded the entire data set from the proj.org site? |
If you look at the metadata of the grid (gdalinfo), you can see this is actually ETRS89 (EPSG:4937)
This is from a contributor. We don't guarantee anything. It might eat your children etc. The lineage of the file is indicated at https://github.com/OSGeo/PROJ-data/tree/master/uk_os#united-kingdom-osgm15-height-odn-height---etrs89-ellipsoidal-heights and the conversion script used to generate uk_os_OSGM15_GB.tif at https://github.com/OSGeo/PROJ-data/blob/master/uk_os/OSGM15_GB.sh |
Hi @dfileccia, Recomened transformation pipeline for
Here geoid height is applied to the coordinates in ETRS89, not WGS84. As I know difference between these CRS can be up to 1m in Europe. |
Hi Andrei,
Thank you for this.
I am very new to PROJ (not so much GDAL) but I am trying to decipher your string. It looks like it does the grid shift with WGS84 lat/lon values and doesn't convert and do hshift until after the vshift. It also seem everything up to, and including, "+inv" can be removed.
Is there a more direct way to convert WGS84 lat/lon pairs into ETRS89 lat/lon pairs? I have tried proj_crs_to_crs and it fails all the time in the transform. My software can use BIN grids from NGS directly, australian grids, etc. Seems like UK is the one that gives me the most problems.
David Fileccia
I have been all things unholy. If God can work through
me, he can work through anyone. -- Francis of Assisi
…________________________________
From: Andrei Marshalov <notifications@github.com>
Sent: Thursday, September 24, 2020 3:35 AM
To: OSGeo/PROJ <PROJ@noreply.github.com>
Cc: David FIleccia <dave_fileccia@outlook.com>; Mention <mention@noreply.github.com>
Subject: Re: [OSGeo/PROJ] GeoTIF files for UK don't yield expected results when used in GDAL (#2360)
Hi @dfileccia<https://github.com/dfileccia>,
You can look at my PR where we discussed the accuracy of this geoid OSGeo/PROJ-data#25<OSGeo/PROJ-data#25>. To get the accuracy and RMSE I used test data from the Ordnance Survey<https://www.ordnancesurvey.co.uk/business-government/tools-support/os-net/for-developers> survey developer pack compared to transformation EPSG:4258 -> EPSG:27700+5701 with gdaltransform CLI utility.
Recomened transformation pipeline for EPSG:4258 -> EPSG:27700+5701 is:
unknown id, ETRS89 to ODN height (2) + Inverse of OSGB 1936 to ETRS89 (2) + British National Grid, 0.038 m, UK - Great Britain mainland onshore
PROJ string:
+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +inv +proj=vgridshift +grids=uk_os_OSGM15_GB.tif +multiplier=1 +step +inv +proj=hgridshift +grids=uk_os_OSTN15_NTv2_OSGBtoETRS.tif +step +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy
Here geoid height is applied to the coordinates in ETRS89, not WGS84. As I know difference between these CRS can be up to 1m in Europe.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2360 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA5CAQUTUD2XL2PO2P3FKB3SHLZE3ANCNFSM4RXHY4TA>.
|
That proj-string I've posted is output of projinfo utility, try it out, it helps to understand the sequence of transformation and possible variants. I think I should mention that each geoid file has its own expected CRS of input coordinates. For OSGM15 it's ETRS89, so for results to be correct you should apply geoid to coordinates in ETRS89. By the way, there are two geoids in Australia and they also should be applied not to WGS84, but to GDA97 or GDA2020. In the transformation above we have next steps:
I think you may not be interested in last two steps, but you should notice that there are not coordinates in WGS84 at all. You can't measure accurate enough in WGS84 since it's aligned to the Earth center, when ETRS89 - to the continent. And the continent is moving relative to the center of the Earth all the time. The question is where do you get your source coordinates from? For surveying there are so called NTRIP providers that provide base point with coordinates in the continental CRS. They are different for each country, in Europe it mostly ETRS89. |
Hi Andrei,
The coordinates come from our GNSS receiver as WGS84 lat/lon/height. It seems that the lat/lon for WGS84 and ETRS89 are very close. I see no difference in the data. Now, I know that after you run through the projection, you have to grid shift the horizontal. I am getting good numbers for that. It is just the geoid height! I will keep playing with the transform and see what I can do.
Thank you for your explanation. It is very helpful.
David Fileccia
I have been all things unholy. If God can work through
me, he can work through anyone. -- Francis of Assisi
…________________________________
From: Andrei Marshalov <notifications@github.com>
Sent: Friday, September 25, 2020 3:39 AM
To: OSGeo/PROJ <PROJ@noreply.github.com>
Cc: David FIleccia <dave_fileccia@outlook.com>; Mention <mention@noreply.github.com>
Subject: Re: [OSGeo/PROJ] GeoTIF files for UK don't yield expected results when used in GDAL (#2360)
That proj-string I've posted is output of projinfo utility, try it out, it helps to understand the sequence of transformation and possible variants.
I think I should mention that each geoid file has its own expected CRS of input coordinates. For OSGM15 it's ETRS89, so for results to be correct you should apply geoid to coordinates in ETRS89. By the way, there are two geoids in Australia and they also should be applied not to WGS84, but to GDA97 or GDA2020.
In the transformation above we have next steps:
1. geoid height correction applied to coordinates in ETRS89
2. Datum conversion for horizontal coordinates from ETRS89 to OSGB1936 by horizontal grid
3. applying projection to the coordinates in OSGB1936
I think you may not be interested in last two steps, but you should notice that there are not coordinates in WGS84 at all.
You can't measure accurate enough in WGS84 since it's aligned to the Earth center, when ETRS89 - to the continent. And the continent is moving relative to the center of the Earth all the time. The question is where do you get your source coordinates from? For surveying there are so called NTRIP providers that provide base point with coordinates in the continental CRS. They are different for each country, in Europe it mostly ETRS89.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2360 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA5CAQRHJ23Z2C6SDVOLSJDSHRCMLANCNFSM4RXHY4TA>.
|
@dfileccia, try to compare your results with ones from the Ordnance Survey developer pack. You can skip horizontal coordinates transformation and check only if heights are matching. At least we'll find out if you're using the same transformation as me. |
I did that before I got your information. You mentioned I could leave off one step. Are you talking about the hgridshift or the last step going thought "Airy"? What I really need is the PROJ conversion from WGS84 to ETRS89 lat/lon so I can read the file in our framework. I have a table comparison sample: This is comparing against OSTN02 and OSTN15.
LAT LON HGT OSTN02 OSTN15 PROJ
57.15709900 -2.11771100 100.000 50.206 50.230 49.771
57.65421900 -2.05135300 100.000 50.631 50.650 49.354
58.55106100 -4.88868400 100.000 45.561 45.590 54.404
58.10691000 -4.49657500 100.000 46.216 46.250 53.755
52.44485000 -1.80913300 100.000 50.475 50.500 49.503
The data above was done with simple LLH query into the vertical grid. When I converted to ETRS89 lat/lon, there was no difference in the lat/lon values from WGS84. So, I still must be doing something wrong.
David Fileccia
I have been all things unholy. If God can work through
me, he can work through anyone. -- Francis of Assisi
…________________________________
From: Andrei Marshalov <notifications@github.com>
Sent: Friday, September 25, 2020 8:26 AM
To: OSGeo/PROJ <PROJ@noreply.github.com>
Cc: David FIleccia <dave_fileccia@outlook.com>; Mention <mention@noreply.github.com>
Subject: Re: [OSGeo/PROJ] GeoTIF files for UK don't yield expected results when used in GDAL (#2360)
@dfileccia<https://github.com/dfileccia>, try to compare your results with ones from the Ordnance Survey<https://www.ordnancesurvey.co.uk/business-government/tools-support/os-net/for-developers> developer pack. You can skip horizontal coordinates transformation and check only if heights are matching. At least we'll find out if you're using the same transformation as me.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2360 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA5CAQVO4XYJDXMIWR4XSKLSHSD55ANCNFSM4RXHY4TA>.
|
I've tried to convert your test points, look at my results:
Close enough to required |
Thank you, Andrei! I have it now. I left off the "+inv" from the end of my string. Now I get the correct results.
pj_open_lib(D:/MSys64/home/DFileccia/Workspace/Geoids/proj/uk_os_OSGM15_GB.tif): call fopen(D:/MSys64/home/D24 57.41537800 -6.50149800 100.000 44.124 44.090 44.085
25 57.45677100 -4.20043300 100.000 47.007 47.040 47.038
26 57.15709900 -2.11771100 100.000 50.206 50.230 50.229
27 57.65421900 -2.05135300 100.000 50.631 50.650 50.646
28 58.55106100 -4.88868400 100.000 45.561 45.590 45.596
29 58.10691000 -4.49657500 100.000 46.216 46.250 46.245
30 52.44485000 -1.80913300 100.000 50.475 50.500 50.497
David Fileccia
I have been all things unholy. If God can work through
me, he can work through anyone. -- Francis of Assisi
________________________________
From: Andrei Marshalov <notifications@github.com>
Sent: Friday, September 25, 2020 9:02 AM
To: OSGeo/PROJ <PROJ@noreply.github.com>
Cc: David FIleccia <dave_fileccia@outlook.com>; Mention <mention@noreply.github.com>
Subject: Re: [OSGeo/PROJ] GeoTIF files for UK don't yield expected results when used in GDAL (#2360)
I've tried to convert your test points, look at my results:
> echo -2.11771100 57.15709900 100 | ./cct +proj=vgridshift +grids=uk_os_OSGM15_GB.tif +multiplier=1 +inv
-2.1177110000 57.1570990000 50.2294 inf
Close enough to required 50.230. Therefore I suppose the geoid is correct and your WGS84 points are close enough to ETRS89 to don't convert them. So, yes, you're doing something wrong =)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2360 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA5CAQVOICKZ3RIHDAQ23HTSHSIGHANCNFSM4RXHY4TA>.
|
I never use the command line tools. I should really learn to use them. Thanks again!
David Fileccia
I have been all things unholy. If God can work through
me, he can work through anyone. -- Francis of Assisi
________________________________
From: Andrei Marshalov <notifications@github.com>
Sent: Friday, September 25, 2020 9:02 AM
To: OSGeo/PROJ <PROJ@noreply.github.com>
Cc: David FIleccia <dave_fileccia@outlook.com>; Mention <mention@noreply.github.com>
Subject: Re: [OSGeo/PROJ] GeoTIF files for UK don't yield expected results when used in GDAL (#2360)
I've tried to convert your test points, look at my results:
> echo -2.11771100 57.15709900 100 | ./cct +proj=vgridshift +grids=uk_os_OSGM15_GB.tif +multiplier=1 +inv
-2.1177110000 57.1570990000 50.2294 inf
Close enough to required 50.230. Therefore I suppose the geoid is correct and your WGS84 points are close enough to ETRS89 to don't convert them. So, yes, you're doing something wrong =)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#2360 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA5CAQVOICKZ3RIHDAQ23HTSHSIGHANCNFSM4RXHY4TA>.
|
Since I have not found a place to ask questions:
I am using PROJ.4 7.1.1 and GDAL 3.1.3 trying to read the updated proj-data files to get the orthometric values for the UK since the toolkit provided by the national survey doesn't play well with our system. According to the README file there should only be an error of 0.00076m error from the source files but I am seeing 1m+ errors.
With other files (Australia, US, etc), I am seeing <= 1cm error which we would consider acceptable since we are a non-survey application.
My code to read the files is pretty simple for my test:
The doInterpolate is a long standing function used for all our geoid formats we support so I know it is OK. There are no good examples on reading the data from the file just what I can deduce from GDAL.
Is there a way to read these files using the PROJ api?
Thanks for any help you can get me.
The text was updated successfully, but these errors were encountered: