Esri / coordinate-conversion-addin-dotnet

Addin for ArcMap and Pro for convenient coordinate conversion in Desktop.
Apache License 2.0
45 stars 20 forks source link

MGRS doesn't match USNG value for same DD coordinate (ArcGIS Pro) #273

Closed elinz closed 7 years ago

elinz commented 7 years ago

MGRS and USNG values should match. ArcMap and the Widget are creating correct output where MGRS and USNG values that match. NOTE: the MGRS/USNG values that ArcMap and the widget are creating match what the ArcMap Identify tool creates.

I went back and tested previous builds to determine when the problem started and the issue started after the build 12 Jan 11:18

image

The MGRS values should match the USNG values (i.e. the USNG value is the correct values for both MGRS and USNG at the specified DD value).

Entering DD: 45.0N 100.0W produces output: MGRS: 14TMQ2118483436 USNG: 14TMQ2118583437

Entering DD: 45.0N 100.0E produces output: MGRS: 47TNK7881583436 USNG: 47TNK7881583437

Entering DD: 45.0S 100.0W produces output: MGRS: 14GMR2118416563 USNG: 14GMR2118516563

Entering DD: 45.0S 100.0E produces output: MGRS: 47GNL7881516563 USNG: 47GNL7881516563 (In this case the MGRS and USNG values match)

elinz commented 7 years ago

Here is some additional info I collected:

image

Coordinates in red are those that don't match the output from the ArcMap Identify, which is the baseline. The coordinates in greee are those that match the output from ArcMap. According to @kgonzago the output coordinates from the addins should match ArcMap. image

image

image

image

elinz commented 7 years ago

@kgonzago @nfeuerstein This highlights are need to add unit tests to verify input coordinate with expected output coordinates in the various coordinate notations.

nfeuerstein commented 7 years ago

Notes for tomorrow: Thanks Eric. This is a showstopper and will need to be resolved before we can ship.

topowright-zz commented 7 years ago

@dhagens you are awesome!!! This has been fixed and I have verified that the coordinates now match. @elinz I will let you close the issue.
I have tested this in build 01-17-2017_1131

elinz commented 7 years ago

@dhagens @topowright I will install latest build and test.

elinz commented 7 years ago

@dhagens @topowright @nfeuerstein While the MGRS and USNG coordinates do match in Pro they are not the same coordiantes as in the ArcMap addin and the widget and not what was expected. Looks like the Pro addin was modified so that the USNG coordinate would match the MGRS coordinate, instead of the other way around. The USNG being output from Pro addin before was correct.

In the screenshots below, Pro addin on left and ArcMap addin on the right. image

image

image

image

Assigning back to @dhagens

dhagens commented 7 years ago

The change to MGRS previously was a fix for where the ArcGIS Pro output under the map was not matching the output we were seeing in the coordinate tool when hovering on the map. We cannot change that back w/o reinstating that bug. If you want the MGRS / USNG to be the same, this fix makes that work.

dhagens commented 7 years ago

@elinz, @topowright , @nfeuerstein, I think that this will just have to be documented. We can't change the MGRS back because that will cause the MGRS output in our tool to be different than the output being displayed in Pro. For most cases that I've tested, the MGRS in Pro and ArcMap are the same.
For example (just some random locations I selected on the map): 45.015427N 099.964321W - Same MGRS in both 47.706587N 093.563424W - Same MGRS in both 30.717900N 083.267816W - Easting and Northing are off by 1

My guess is that the coordinates being displayed in ArcMap are using rounding, whereas the coordinates being displayed in Pro are not using rounding. If we want our output to match the output being displayed in the Addins for the given platform, we have to match the rounding being used in our code. So we can't change the addin to use rounding in Pro and still display the same output as Pro does.

dhagens commented 7 years ago

I tested a coordinate using a conversion tool at www.earthpoint.us and compared it to our results: image

Pro image

ArcMap image

As you can see, the output from ArcMap for MGRS Easting is off by 1 in ArcMap. Again, my assumption is that ArcMap is using rounding to display the MGRS coordinates and we have to mimic that in our addin so that our MGRS ouput is not different than what is being displayed in ArcMap.

elinz commented 7 years ago

@nfeuerstein @topowright Thanks for the additional info @dhagens. I understand what's going on now.

What I didn't realize was that ArcGIS Pro and ArcMap coordinate "read-out" at the bottom of the map gives you different results for a given location (i.e. 1 meter off); I'm also assuming that ArcMap map read-out is using the MGRS rounding property. In earlier builds of the Pro addin, the Coordinate Conversion addin was returning a MGRS coordinate that matched the MGRS coordinate returned from the ArcMap addin, however, this coordinate didn't match the ArcGIS Pro "read-out". Now the coordinates returned by Coordinate Conversion addins match the "read-out" of the respectively application.

For example, here is screenshot from ArcGIS Pro addin: image

If I type the same coordinates in the ArcMap addin: 65.182952N 102.520200W, the output MGRS is off 1 meter from what the Pro addin returns, but this coordinate matches what the ArcMap "read-out" returns. image

I will close this issue because the addins are returning the same MGRS/USNG coordinate for a given location respective of the application they are running in.