-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add support for Universal Polar Stereographic #33
Comments
US ARMY TEC-SR-7 1996 is the latest reference I have in terms of UPS/ MGRS POLAR conversions. We implemented it in CoordinateSharp, but the precision loss is extremely poor during conversions we have found. It ranges from 0-33m between the 80/84-88th parallels and up to 2.2km above the 88th parallel as you near the poles. Other services we tested against seem to exhibit similar results. Would love to work on this with you in terms of formulas if you have any advancements or additional resources on this. The polars aren't used often, so there seems to be little in terms of public resources on conversions into and out of the system. |
Hi, @Tronald . Have you taken a look at https://github.com/codice/usng.js/? I haven't tested their UPS conversions yet, but seems promising. I'd also love to contribute to any efforts to provide more consistent and reliable UPS conversions. Personally, I'm trying to get IBCAO 4.0 on a web map and I need a UPS solution to do that. Thanks for reaching out! |
I just reviewed the package and I believe they are experiencing problems with UPS to LL conversions. The LL to UPS results appear to be consistent with ours at a glance (within a meter). We gauge our precision results by getting the differences of conversion-to-converted back values though. Precision = (LL -> UPS) - (UPS -> LL) Their convert back logic doesn't seem to work (not sure what's going on), so I can't even gauge the precision loss. I could just be using it wrong though (I'm weak when it comes to JS). |
Hmmm... I wonder what could be the cause of it. Have you checked out GEOTRANS and see how they are doing it? I published a container to dockerhub under geodesy/geotrans that you can use to get easy access to the code. You can run it with |
I actually hadn't looked at the GEOTRANS source, so that would be a great resource to have thank you. GEOTRANS 3.8 suffers precision loss as well. It is slightly different than CoordinateSharp (CS), but I wonder if the truncation is being handled different with GEOTRANS 3.8. Example ProblemWGS 1984 Ellipsoid CoordinateSharp LL INITIAL: N 88º 36' 36" E 95º 41' 9.6" PRECISION LOSS: +0.003 seconds N / - 0.7 seconds E GEOTRANS LL INITIAL: N 88º 36' 36" E 95º 41' 9.6" PRECISION LOSS: 0 seconds N / +0.6 seconds E. As you can see the precision loss between the two is close. It looks as if the full Northing float value after conversion in CS is 2015290.529... Truncating vs Rounding will change that meter square. This makes me wonder if GEOTRANS 3.8 is rounding vs truncating. I tested against Earthpoint.us and their result was the truncated Northing value that CS exhibits. If I adjust the Northing by one meter (2015291mN) in CS and convert back to LL the results are almost identical to GEOTRANS. My unit tests are heavy for UPS and MGRS Polar, but they are ran against Earthpoint with a 1 meter delta to UPS and a .0003 second delta back to LL. I will look into making one to run against GEOTRANS to determine the delta between the formulas of each tool. If the results show a similar delta and precision loss during conversions, then I think there may just be a limitation between the two systems when converting. I wonder if GEOTRANS has specified conversion precision loss in their documentation anywhere? |
Hi, @Tronald . This is very interesting research. Thank you! Here's some code from
It appears that the conversions fails GEOTRANS tests if the discrepancy is greater than It's not a part of the standard AFAIK https://en.wikipedia.org/wiki/Military_Grid_Reference_System, but if the precision loss is an issue when converting to a grid-based reference system, we could discuss providing an option for a result with greater than 5 digits of precision? Obviously, there'd be a pre-processing step required to make this integrate with other libraries. (I'll also want to double-check with the proj4js owners before adding this functionality). If you're interested, it might also be useful to create a separate library focused just on UPS that this library could support. My thinking is that there's some applications for UPS that don't need all the other MGRS stuff. Thank you! |
Great Info. The 1 meter delta makes sense to me. They are also using double E/N values which means they are testing at the centimeter level to avoid precision loss. I wonder where they obtained their test case values? Is the list of test case values provided in the source, I would love to have it (haven't had a chance to look)? We have the double values available option in CoordinateSharp (as of a year ago) as other users presented similar issues to us. It certainly corrected them so I think it would be smart to include an option for all the grid based systems proj4js includes. Upon further research it looks like TEC-SR-7 references DMA TM 8358.2. The manual has more detailed formulas and describes convergence and scale factor distortion a bit. This distortion may be what we are seeing and it certainly appears larger with the UPS system. Uncorrected distortion mixed with truncating and rounding rules would certainly make for the precision losses. I need to run tests in my own library at the centimeter precision level to see how much it corrects. Thanks for bouncing ideas back and forth. I think it will help both our cases. |
For polar regions, mgrs switches from UTM to Universal Polar Stereographic:
https://en.wikipedia.org/wiki/Military_Grid_Reference_System#Polar_regions
For previous discussion see: #11
The text was updated successfully, but these errors were encountered: