PSU-CSAR / vb-bagis

Source code for BAGIS V3 ESRI Add-In
0 stars 1 forks source link

AOI Utilities - Set AOI tool #25

Closed jdduh closed 7 years ago

jdduh commented 7 years ago

First, I found it really slow to set an AOI using the Set AOI tool. Is it because of the query of DEM metadata? Or is it also related to the weasel AOI files compatibility function?

Second, when an earlier session had a BASIN and an AOI selected, the Set AOI tool doesn't reset the BASIN and AOI information associated with the toolbar.

The first image shows that after setting the AOI to test_aoi, which has nothing to do with the test_BASIN, BAGIS still displays the current BASIN as test_BASIN.

The second image shows that when the "Select AOI" button is clicked, the AOI Tool dialog window still showing the AOI(s) associated with the BASIN.

The third image shows the correct behavior when the AOI is set by the Set AOI tool.

image

image

image

lbross commented 7 years ago

I need some clarification on this issue as I'm not sure how it is supposed to work:

Item 1: Are you talking about the Set AOI Tool (button) or setting the AOI using the AOI Utilities form. The AOI Utilities form is quite slow but the Set AOI Tool seems almost instantaneous to me.

Item 2: When I set the AOI using the AOI Utilities form, it does not reset the basin to null. Should this be fixed?

Item 3: When I set the Basin using the Select Basin tool, it does not reset the AOI to null. Should this be fixed?

New item: It seems odd that selecting an AOI using the AOI Utilities form activates the AOI Tool button but when you click on it, you can't use it unless you have a BASIN selected.

Am I missing anything else?

jdduh commented 7 years ago

Item 1: I was talking about the AOI Utilities form. Item 2: Yes, please set BASIN to null when setting the AOI with the AOI Utilities form. Item 3: Yes, please set AOI to null. Make sure the Analysis and Maps menu items are also reset. Item 4. I think if you reset the BASIN in Item 2, then the AOI tool will be disabled as well (?). When AOI is set with the AOI Utilities form, the Set AOI tool should be disabled.

lbross commented 7 years ago

Item 1: The holdup is in calculating the raster statistics to get the min/max elevation and range. You can take a look at GeodatabaseModule.BA_GetDemStatsGDB() to see if you have any suggestions on making it faster. We could also see if there is a Geoprocessing tool but this would be the first time geoprocessor is faster than ArcObjects (if it is).

lbross commented 7 years ago

Item 4: This is not working as advertised but I will fix. If you select a BASIN should the AOI tool be enabled so you can select an existing AOI from the basin? Should it be dependent on whether there are any AOI's in the basin?

jdduh commented 7 years ago

You are right about the first part of Item 4. When a BASIN is set, the Set AOI tool should be enabled, but the current AOI needs to be reset (i.e., Item 3). However, when AOI is set with the AOI Utilities form, the current BASIN is set to null (i.e., Item 2) and the Set AOI tool should be disabled (thus, Item 4).

lbross commented 7 years ago

I found what may be another issue with the Basin Tool. There is this code that checks to see if the DEM FGDB exists before it checks to see if there are are any AOIs in the basin: If UCase(lblDEMStatus.Text) = "YES" Then

The problem is that lblDEMStatus.Text shows the resolution instead of yes/no. See attached screenshot. Therefore BAGIS V3 never checks to see if there are AOIs and could allow the user to reclip the DEM. Actually ... this could be why the AOI info isn't reset when a basin is selected.

Please advise. How about looking for the word 'resolution' in lblDEMStatus.Text?

basintool

jdduh commented 7 years ago

Yes, you are right - if a BASIN has AOIs in it, then the DEM cannot be reclipped. Please search for RESOLUTION in the text to determine if a folder is a BASIN. If the folder happens to be also an AOI, then we don't allow DEM reclip either.

lbross commented 7 years ago

This should be fixed in the next version of BAGIS v3. Please test carefully as there are many possible permutations of behavior.