-
Notifications
You must be signed in to change notification settings - Fork 108
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
Inaccurate import of images and tracks that use geographic coordinates #2196
Comments
I agree that EPSG:4326 is poor for geographic coordinates, and that something like EPSG:7667 is an improvement. It's been a long time since when I looked at this issue. Initializing PROJ differently did not appear to be an option. |
I think that accurate GNSS receivers and data will be more and more used, so it seems to me logical to stop using low precision ensemble which is based on dynamic datums. For example if you want to save any data to 4326, QGIS now warns you about limited accuracy. Thinking about this, not sure what is the best solution. What about to add parameter in Mapper settings where you can define WGS84 epoch for importing data? |
pkturner - If your tests were before ~2019, EPSG files did not include shifts. So your tests with GDAL/PROJ would be as you describe (I had the same experience). Now, most of the newer ones do. |
@sfroyen
I think you mean EPSG:7665. For PROJ, I know how EPSG:7665 could be substituted for |
@pkturner Here's a table of EPSGs for WGS84: 1994 G730 EPSG:7656 (x,y,z), EPSG:7657 (lat,lon,h), EPSG:9053 2D (lat,lon) For my location we currently* use NAD83(2011) UTM 13N / EPSG:6342 Running the shell script below (location ~40N 105W) produces a table of EPSG:6342 coordinates for various WGS84 realizations. for i in 4326 7657 7659 7661 7663 7665 9754 EPSG:4326 to EPSG:6342 Note that EPSG:4326 as well as all WGS84 realizations before 2012 (EPSG:7663) are missing the shifts. |
PROJ and GDAL now support combining epoch with CRS.
Notice that WGS 84(G1762) is synonymous with EPSG:7665, and PROJ implicitly assigns an epoch of 1997.
Notice that WGS 84 (G2139) is synonymous with EPSG:9754, and PROJ implicitly assigns an epoch of 2010. The point of these examples is that for the recent realizations of WGS 84 that PROJ handles dynamically, the calculation of shift is dependent on the epoch much more than the specific realization. The epoch should be determined by the date of the observation, e.g. by the date when a track was recorded. And the relationship has shifted another 23 cm since the epoch assumed by PROJ for EPSG:9754.
The fix suggested by @sfroyen, if it can be implemented, would beg for Mapper to also support the epoch of observations for tracks and for imagery that is georeferenced to WGS 84. |
By the way, OpenStreetMap uses WGS 84 latitude and longitude for its data. It is disturbing to think of all of OSM's data on North America slowly becoming erroneous as the continental plate drifts away. |
@pkturner, I believe that high accuracy archived GNSS data is usually recorded with positions transformed back to the frame epoch. For the coordinates of a location today one therefore has to transform the archived coordinates using a Helmert transformation with the time elapsed since the epoch. For autonomous GPS measurements, the positions are provided in present time realization of WGS84. For archival accuracy these should be transformed back to the frame epoch. When using SBAS corrections, the positions would use the realization of SBAS satellite. (I read somewhere that WAAS satellites are updated every 6 months.) Similarly, for RTK corrected data, the realization is whatever the RTK provider uses. For orienteering mapping, the differences caused by time are not important. For updates of older maps, the map's georeferencing could be adjusted to match the current realization (keeping map coordinates as is and shifting the geographic and reference coordinates to match). My original post was meant as simple fix for the incorrect shifts of images and gps tracks. These tend to be recent data with coordinates very close to the current WGS84 realization, so using G2139 (EPSG:9754) should be optimal in almost every case. And for other cases, it should be no worse than the default (EPSG:4326). If needed, we could add a UI for CRS selection later. |
The workaround steps using QGIS are as follows (I'm hoping this description might suggest a OOM fix):
The purple point symbols were added to the map using Android OOM and a high accuracy GPS (using RTK with current WGS84 realization as the correction CRS). The shifts are ~1m. The location is an unused runway, northern end at the US Air Force Academy. |
... and, of course, the gpx track templates They are positioned incorrectly both when added as templates and when imported as map objects. Could those cases be handled like the image templates, with an option to select a CRS and a default to use EPSG:7665 (or later)? |
@sfroyen said
I'm only now fully analyzing your report. Originally I accepted your prescription of of hardcoding EPSG:7667 into Mapper almost everywhere. I even put an effort into implementing that fix (#2205). Then I had to look again, because the fixed Mapper places GPX tracks in the same position as v0.9.5 (as long as GDAL is disabled). The shift that your images show -- I agree it is in the QGIS creation of the image in EPSG:6342. I have analyzed the shift which @dg0yt encountered in #2008 (NAD83 changes in PROJ 8.2.0), and the two appear the same. What I think happened is
I suggest you check how Mapper v0.9.5 handles GPX tracks on your EPSG:6342 maps. If it's not shifted, then this report is a duplicate of # 2008. |
@krticka Your comment about "You never know what transformation is being used" is an interesting point. PROJ has an ability to dump the transformation, at least on the command line. As a feature in Mapper I expect it would rarely be used, but for your case it would be worthwhile. |
Steps to reproduce
Actual behaviour
Any georeferenced data that use geographic coordinates is offset when added as a template.
Expected behaviour
Georeferenced data using geographic coordinates are not offset when added as templates.
Root cause
It appears that OOM is not specifying a default EPSG for geographic coordinates. Without a default, GDAL/PROJ uses EPSG:4326. This is an ensemble EPSG that assumes all geographic coordinate datums are the same and ignores the shifts that have accumulated over time. I have verified that this is the cause of the shifts by using QGIS to convert the images and tracks from EPSG:7667 (the 2019 datum revision) to EPSG:6342. When importing the converted files as templates, the shifts are gone.
Fix
Hardcoding EPSG:7667 in the initialization of GDAL/PROJ would almost all of the cases. Adding a configuration setting for the EPSG code would solve any issue with (very) old data (pre 2012).
PS There are several other issue reports that discuss the same issue. I filed this issue because I have a simple solution that will fix most of the other cases.
Configuration
Mapper Version: 0.95
Operating System: MacOS Sonoma
The text was updated successfully, but these errors were encountered: