Esri / visibility-addin-dotnet

ArcGIS Add-in provides the capability to quickly do line of sight analyses.
Apache License 2.0
14 stars 19 forks source link

LLOS: coordinate system check is not correct (ArcMap) #118

Closed elinz closed 7 years ago

elinz commented 7 years ago

The addin is comparing the coordinate system of the data frame with the coordinate system of the input surface. When they don't match the tool presents the following error message: image

This is not the requirement for this tool to run. The requirement is for the input surface to be in a projection coordinate system.

The RLOS tool is performing the correct check and when the input surface is not in a projection coordinate system the tool presents the following error message: image

Modify the LLOS tool to perform the same check. NOTE: the ArcGIS Pro addin tools LLOS and RLOS are performing the correct check and displaying the same error message that the RLOS ArcMap tool is displaying.

dhagens commented 7 years ago

@elinz Ready for testing

topowright-zz commented 7 years ago

verified

BobBooth commented 7 years ago

@topowright @elinz @dhagens - I'm seeing something with LLOS in ArcMap (installed today's build) where it checks to see if the input surface is in projected coordinates (good), but when I project my DEM and add it to my map (originally CS of data frame and all layers GCS_WGS_1984), I can run the tool and I get unrealistic results - point A is visible from point B even though it is on the other side of a mountain range. If I change the data frame CS to the CS of my raster, the results are correct. image Top one with data frame & DEM CS = projected UTM Bottom one with just the DEM CS = projected UTM (data frame CS geographic GCS_WGS_1984).

dhagens commented 7 years ago

@BobBooth, Can you verify that the same scenario is different than what you see when running the core GP tools for LOS?

BobBooth commented 7 years ago

@dhagens - my GP tools are messed up now (https://github.com/Esri/military-tools-geoprocessing-toolbox/issues/199). However, if I re-path the script for LLOS to its new location it runs. I ran it with the GCS_WGS_1984 CS for the data frame (and the elevation data in UTM) and it ran with warnings: WARNING 000632: Datum conflict between map and output. WARNING 000632: Datum conflict between map and output. WARNING 000632: Datum conflict between map and output. WARNING 000632: Datum conflict between map and output. The output symbology is wrong (just a purple line) but I get a profile graph that looks right. image

If the data frame in in the UTM projection it runs without those warnings. The layer symbology is still messed up (monochrome blue), but the profile graph looks right. image

BobBooth commented 7 years ago

@mfunk - FYI

dhagens commented 7 years ago

So it appears that the output from the core GP Tools doesn't handle this correctly either. I'd have to look into this one further to see how long it would take to fix. In the middle of fixing another bug right now. We may want to add this in the documents that incorrect results will occur if CS of dataframe and surface don't match (or the exact scenario that you mentioned above) @nfeuerstein @topowright Thoughts?

BobBooth commented 7 years ago

@dhagens - I think the GP tools (in ArcMap) are handling it almost right - I think the symbology is broken because of the path issue with the tools (so they aren't finding the LYR file, I'd guess). The profile graphs look right, anyway.

dhagens commented 7 years ago

@elinz, @BobBooth , you should now get back a message indicating that the coordinate systems must match for the selected surface and the dataframe when running LLOS. This is ready for testing.

elinz commented 7 years ago

The Pro and ArcMap LLOS/RLOS tools have different requirements with regards to the spatial reference. In Pro, the input surface has to be in a projected coordinate system, while the map/data frame can be in any coordinate system. For ArcMap LLOS, the input surface has to be in a projected coordinate system and the data frame has to be in the same project coordinate system as the input surface.

For the ArcMap LLOS tool, the coordinate system checks should be performed in the following order:

  1. Verify that the input surface is in a project coordinate system.
  2. Then verify that the data frame has the same coordinate system as the input surface.

Verification testing (used ArcMap addin build 09 Jan 2017 16:49 on ArcMap 10.3.1 final):

  1. Added the World Topographic base map (WGS 1984 Web Mercator (aux sphere), which is a project coordinate system) to the data frame.
  2. Added a surface that has a geographic coordinate system to the data frame. Use this surface in the LLOS interface.
  3. Added a few observer points and a target point. Run the tool.
  4. The tools displays the following message (which is expected): image
  5. Add a surface that's in WGS 1984 Web Mercator (aux sphere) to the data frame and use this surface in the LLOS interface.
  6. Change the coordinate system of the data frame to a GCS such as WGS 1984 (this test is to verify that the tool throws the message about the coordinate systems of the data frame and surface having to be the same).
  7. Added a few observer points and a target point. Run the tool.
  8. The following message box is displayed (which is expected): image
  9. Change the coordinate system of the data frame to a projected coordinate system (for example Polyconic (world)), but not the same as the input surface (this is another variation of the test above. This test makes sure the tool isn't just checking for any projection coordinate system, but the same as the input surface)
  10. Added a few observer points and a target point. Run the tool.
  11. The following message box is displayed (which is expected): image
  12. Change the coordinate system of the data frame to match the input surface which is in a projected coordinate system).
  13. Added a few observer points and a target point. Run the tool. This time the tool should run without throws any coordinate system error messages. Results: the tool runs without any coordinate system error messages and produces an output.
BobBooth commented 7 years ago

LLOS (ArcMap Addin) coordinate system check not right - I just added a basemap to get the Web Mercator projection, added a UTM projected raster, did LLOS. Get all "Visible" when should not be. image @dhagens @elinz @lfunkhouser @nfeuerstein

BobBooth commented 7 years ago

@Dbarnes1 & @dfoll The LLOS doc in ArcMap PDF says "The input surface data must be in a projected coordinate system, and the data frame must have the same spatial reference as the input surface data." (Creating linear lines of sight p.28) If we don't actually check in the software to verify that the CS is valid for the analysis, we probably need more detailed info/warning that this will give bad results.

dhagens commented 7 years ago

Unfortunately, the ArcObjects tools that are being called don't return any type of feedback indicating that the results are incorrect, the call either returns true or false. This can be updated in the documentation and make the user aware that if the coordinate systems don't match, invalid results may occur.

BobBooth commented 7 years ago

@dhagens - but the RLOS tools check to see if the CS is right - at least somewhat - I get a "something went wrong" message when I try to run it in Web Mercator. LLOS just goes ahead and runs, creating incorrect results.

dhagens commented 7 years ago

@BobBooth, I would suggest testing this out using the GP Tools. I believe that you will get the same results. I'm not saying that we can't keep the user from running with a different coordinate system, but I believe the core tools run and produce the same results. We can document this for now.

BobBooth commented 7 years ago

@dhagens - Nope, the GP tools seem to produce correct output whether the data frame CS is Web Mercator or UTM. llos_gp_utm_results_right llos_gp_webmercator_results_right @mfunk

dhagens commented 7 years ago

Good catch. Must have been an untested scenario. Could you provide the data somewhere to test with? @nfeuerstein - Your call on this. My suggestion is that we document that the coordinate systems must match and if they do not match, incorrect results may occur. This wasn't initially set as a showstopper.

nfeuerstein commented 7 years ago

@dfoll @Dbarnes1 @lfunkhouser let's document this, this release. Coordinate systems input surface and data frame coordinate systems must match.

dfoll commented 7 years ago

@dhagens @BobBooth doc currently reads ---

"The input surface data must be in a projected coordinate system, and the data frame must have the same spatial reference as the input surface data."

will changing to

"The input surface data must be in a projected coordinate system, and the data frame must have the same spatial reference as the input surface data. If you do not check for this, invalid results may be returned." suffice? if so i can make that change now

dfoll commented 7 years ago

@dhagens @BobBooth @Dbarnes1 i made this change to documentation in only the ArcMap pdf.... will something like this need changed in either the Pro or WAB pdf

BobBooth commented 7 years ago

@dfoll @Dbarnes1 @dhagens - it seems to work correctly regardless of the map CS in Pro.

Dbarnes1 commented 7 years ago

thanks for testing that @BobBooth

BobBooth commented 7 years ago

@dhagens - email me a location where you'd like the data and I'll get you a copy.

csmoore commented 7 years ago

@BobBooth & I looked at together & seems to behaving properly - will let Bob close/verify

image

image

BobBooth commented 7 years ago

Verified using the 3/1/17 Military Tools Add-in and the 3/1/17 Visibility component add-in.