PSU-CSAR / bagis-pro

BAGIS for ArcGIS Pro
4 stars 1 forks source link

Migrate AOI creation process to BAGIS-Pro #53

Open lbross opened 1 month ago

lbross commented 1 month ago

Start with create AOI from shapefile. Clips all the layers and arrange them into an AOI structure. Creates the flow/accumulation layers. New step for tool to create a pourpoint. Intersection with stream network should be the pourpoint. Find location inside shapefile that has the highest allocation value. Interactive tool user needs to digitize a pourpoint. Make decision on which gauge station to use.

lbross commented 1 month ago

@jdduh: Can you provide a sample shapefile for me to work with, hopefully not too big?

jdduh commented 1 month ago

Here is a shapefile for the Animas AOI.

animas_aoi.zip

lbross commented 1 month ago

Thank you. I'm pasting a screenshot of the UI for this function. I plan to replicate the screen as much as possible. Let me know if you would like to make any changes as we proceed with the transition. image

jdduh commented 1 month ago

We need a new BAGIS tool 'group' for 'AOI Creation'. All tools, including the 'create AOI from a shapefile' tool, in the Basin Analyst pulldown menu can be moved to the tool group. image image

lbross commented 1 month ago

This is what I'm working with right now. I created the Basin Analyst tool group a couple of years ago when we started working with ArcGIS Pro. I need a way to trigger the tool. I'm going to focus on the tool for now, but will update the menu before release. image

lbross commented 3 weeks ago

This is what the UI looks like converted to BAGIS-Pro. No code behind it yet. image

lbross commented 3 weeks ago

Just noticed that the height and width of the filter size is always disabled in BAGIS v3. ie: if you choose to filter, it will always be 3x7. Is this intentional?

jdduh commented 3 weeks ago

The Basin Analysis tool group looks good. In this case, we can keep the "About" menu item and "hide" the other menu items that I crossed out. We probably will convert some of the AOI utilities functions to BAGIS Pro later.

The filter size should be customizable by the users. 3 x 7 is the recommended size. The default for DEM smoothing is disable. Here is the description on the setting. image

lbross commented 3 weeks ago

Per our conversation on Tuesday, I'd already made the changes to the menu that you requested earlier. I can make additional changes as needed. This is what I currently have: image I've migrated the 'Why Smooth DEM' MessageBox to BAGIS-Pro and made the filter size customizable. I'm running into some logic that is dependent on the 'Generate AOI Only' checkbox on the BAGIS V3 settings screen. Is this something we still need to support? It seems like an AOI isn't very usable with the BAGIS-Pro reporting if it doesn't have all of the layers.

lbross commented 3 weeks ago

We need to think about where this tool should get the uri's for the clipping. We read the bagis-pro data sources and their uri's from the GitHub server. There is no way to override these, but we do keep a record of them locally for each aoi to include in the pdf report. We also have the default values for the basinanalyst.def online via GitHub and use these a few places in bagis-pro. Then there is the local basinanalyst.def file. BAGIS V3 gets its uris from there. This allows the analyst to override the default settings by using the 'Options' menu. They can also synchronize the options with the default settings at any time.

lbross commented 2 weeks ago

There is a function to add the aoiname, basin, and awdb_id fields to the aoi_v feature class? Are these still the correct fields? Should we be adding station_triplet?

jdduh commented 2 weeks ago

When creating an AOI from a shapefile, the 'station' information is not required. When creating an AOI based on station information, users must create a BASIN first to subset the DEM so that the flowdir and flowacc can be calculated efficiently. Once the BASIN exists, users can create an AOI (within the BASIN) based on an existing station or a location (non-station) that they picked. The stationName and stationTriplet data are available in one of these situations. For other situations, users still need to provide a name for the AOI. This name is not a stationName. When creating an AOI from a BASIN, the BASIN name is propagated to basin attribute of the AOI.

I suggest that, for the create an AOI from a shapefile tool, we keep the original program logics. The AOIs created with this tool need additional methods to find their pourpoints. Once we have the pourpoints, we can then integrate the 'Update forecast station data' tool to see if any of the pourpoints falls close to existing forecast stations.

For AOIs created from a BASIN, we can use the station data or the default station data, when the station doesn't exist, to set the stationName and stationTriplet values and ignore the aoiname and awdb_id fields. Let me know if you have any thoughts.

lbross commented 2 weeks ago

The original program logic for this tool is to add the aoiname, basin, and awdb_id fields to the aoi_v feature class immediately after the feature class is created. As you indicated, there is only enough information available to populate the aoiname field. The other two remain null. An aoi_v feature class should have the same attribute fields regardless of how it was created. They may not all be populated. My only suggestion is to stop creating awdb_id and start creating station_triplet since we no longer use awdb_id. We might also want to start adding station_name at this time.

jdduh commented 2 weeks ago

Let's ditch aoiname and awdb_id field and keep basin. We will set Nodata (or whatever we decided on the default value) on stationTriplet and the AOI name users entered as the stationName for the create an AOI from a shapefile tool. We can just leave the basin name blank.

lbross commented 2 weeks ago

To summarize: For this tool we will add 3 fields to aoi_v when it is created: stationName, stationTriplet, and basin. For this tool, StationName will be set to the value the user enters in the 'Output AOI Name" field. This could be overwritten by the forecast station tool or an integrated version of that logic. The remaining 2 fields will be left null.

lbross commented 1 week ago

Add new fields to batch_settings_tool.json for dem uri, the dem units, and the gauge station layers. Rename BatchSettings to BagisSettings. Give these 3 new data points a unique prefix so that they can be easily found. Make sure we are recording the buffer distance and units for the dem (AoiBufferUnits, AoiBufferDistance). Remove references to PRISM buffer and units from UI.

Add validation to tool to check to see if layers exist (hard stop) and if stationName and stationTriplet exist.