PSU-CSAR / bagis-pro

BAGIS for ArcGIS Pro
4 stars 1 forks source link

Basin Analysis Report - map buffer #30

Closed jdduh closed 1 year ago

jdduh commented 2 years ago

Please limit all the maps to within the AOI boundary. We currently limit the maps to the buffered DEM. This creates some inconsistency in the cartographic presentations of the data. For example, the site representation analysis is preformed within the AOI only (the represented areas stop at the AOI boundaries) while all the other maps extended beyond the AOI boundaries. The request is only for cartographic purpose. There is no change to the underlying analysis.

lbross commented 2 years ago

Do you know how to limit the map display to a polygon in ArcGIS Pro? I recall that we were able to do this in ArcMap but I don't remember how to do it and can't find any information in the ESRI documentation. Does this mean that we don't want to see sites on the map that are outside of the AOI boundary? If so, it seems to conflict with the 5000 m site buffer request.

Also, you posted many to-do items yesterday that will probably take several weeks to complete. Please let me know if there are any priority items in the list. Otherwise I will use my best judgement when working through them.

jdduh commented 2 years ago

https://pro.arcgis.com/en/pro-app/latest/help/mapping/properties/clip-layers-in-a-map.htm It probably works very similar to how it's done in ArcMap. Please exclude the snow survey layers (SNOTEL and Snow Course) from the clipping. All the stations within 5 Km need to be displayed on the maps.

Yes, please use your own judgement to prioritize the requests. I believe some are easier than the other. I have noted on one of the requests that it's of the lowest priority. https://github.com/PSU-CSAR/awdb-retrieve/issues/4

jdduh commented 2 years ago

12 is the highest priority.

29 is the low on priority.

lbross commented 2 years ago

This is done with a little help from ESRI

Edit: Ran into a snag when aoi_v had > 1 polygon (dangles). I tried to buffer as we have done in other places in BAGIS-PRO but when I did that some of the layers would not show on the map. The PRISM-based layers would show, but none of the other ones. I changed it to loop through and pick out the largest polygon if there is > 1. This seems to be working and I don't think the missing dangles will be noticed on the map. Strange!!

jdduh commented 2 years ago

I generated a set of new reports (at ftp://basins.geog.pdx.edu/BAGIS/BAGIS%20Reports/2022-07-26_Reports/). Some Critical Precipitation Zone maps are displayed outside the AOI boundary (some are not). All maps should be displayed within the AOI boundaries. Here are some examples:

09361500_CO_USGS_Watershed-Report.pdf image

08220000_CO_USGS_Watershed-Report.pdf image

lbross commented 2 years ago

I found a GitHub commit from April 20 to exclude the critical precipitation zones layer zones from the clipping. Unfortunately I can't find any backup documentation for why this change was made. Please confirm that you DO want to remove this layer from the exclusion list and I will make the change. This Snotel and Snow Course sites will then be the only 2 layers on the exclusion list.

jdduh commented 2 years ago

Here are sone notes related to CPZ calculation. Let's see if we can piece them together and figure out why we decided to exclude the CPZ layer from clipping in analysis (and cartographic representation?). Maybe, for some AOIs, when the CPZ layer is clipped cartographically, the map becomes obvious that it doesn't match the values shown in the table.

"The elevation zones used in this analysis is the same as the one we used for calculating elevation representation."

lbross commented 2 years ago

I just verified we do mask the area to the AOI boundary in the calculations for the Excel tables. These tables are the basis of the CPZ calculation. The red CPZ layer that is on the map is derived from the elevation zones layer which is the buffered AOI. It's not much work to add the clipping back in for the CPZ map. I can publish a new add-in and you can run some tests.

jdduh commented 2 years ago

Please publish a new addin when the CPZ clipping is implemented. Do you know why some AOIs had their CPZ clipped? These reports were generated in the same run.

jdduh commented 2 years ago

More information related to the CPZ for our earlier correspondence.

April 19, 2022 - from GD "Another issue appears in the report of the other AOI (Marlette Lake Inflow) in the Small_AOIs folder. The critical precipitation zones map doesn't show any critical precipitation zones. The CPZ definition doesn't show up on the table page."

April 20, 2022 - from LB "Item #2: Critical precipitation zones for the Marlette AOI. This is an interesting example, but the tools are (mostly) working correctly in this case. When creating the tables, I had some code that only wrote the comments box if there were > 10 rows. Not sure why I settled on this number. This example has less rows than that, so I set the limit down to 5 which should cover all cases. The map doesn't look right because the critical precipitation areas are outside of the AOI boundary. I'm attaching a map where I've turned off the clipping for that layer. All of the analysis in the charts and tables includes areas outside of the AOI. If this is not what they want, it might take a while to unwind because much of the code is shared with the sites table."

April 20, 2022 - from GD "As to the critical precipitation zones map, I thought the CPZ were outside the AOI boundaries but within the buffered areas. My main concern was the zones definition text was missing from the table. There are two possible solutions: 1) acknowledge that the zones might be outside the AOI and invisible on the map, 2) displace the CPZ map without setting the AOI boundary as the clipping layer (i.e., the map that you attached in your previous email). Have we limited some of the analyses (e.g., site presentation area) to just within the AOI boundary? "

April 20, 2022 -from LB "The zones definition text will show on the table in the next version. My recommendation is to exclude the Critical Precipitation Zones layer from the map layers that are clipped so that it shows up on the map. This is easy to do. We do it for the sites layers."

April 20, 2022 - from GD "Let's exclude the CPZ layer from the clipping list so that it shows up."

lbross commented 2 years ago

I took a deep dive into the CPZ algorithm today. I was concerned because the Zonal Statistics analysis IS masked to the unbuffered AOI, as I reported earlier, but the algorithm was selecting zones outside of the AOI for the CPZ. I found a significant bug when generating the PRISM and Area Elevations charts. The interval list object was generated from the elevation zones layer which uses the buffered AOI extent (as do all of the analysis layers. This is duplicated from BAGIS V3). But the results of the Zonal Statistics tool is masked to the AOI. The algorithm that generates the tables assumed that there would be a zonal statistics row for every interval in the interval list, which there is not when zonal statistics is masked to the AOI. I fixed this and published a new report for the Marlette AOI on CS3. C:\AOIs\Very_Small_AOIs\marlette_lake_inflow_10232010\maps_publish\10336715_NV_USGS_Watershed-Report.pdf. I believe the CPZ is now correct, both on the table and the map, but please review. I'm not 100% comfortable with the other tables so please take a look at those too. Another problem I uncovered in all this, I'm not sure how to solve. If you look at what we are reporting as the minimum elevation of this AOI, it is outside the range of the elevations listed on the corrected CPZ table. We are using the 'Get Raster Properties' tool to calculate the min and max elevations of an AOI. The code set the mask environment variable to the aoi boundary, so we assumed that the calculation was limited to the aoi boundary. However, it is NOT because the 'Get Raster Properties' tool (apparently) does not respect any environment settings according to the tool documentation page. I guess we could start generating a clipped DEM and use that for these statistics, unless you know of a better tool to use? Unfortunately, I think these 2 issues mean we probably have to regenerate all the reports :-( I'm not sure how to respond to your question about some of the AOIs having their CPZ clipped unless it is symptomatic of the bug with the interval list and the statistics table. If one of the intervals in the middle was outside the AOI, it could get weird too. I published a new version of the add-in to basins for you. This version removes the CPZ layer from the clip exclusion list. Hopefully this will allow you to run some more tests.

lbross commented 2 years ago

We will create a new clipped DEM layer during the batch tool report creation and use this layer throughout the process, including the elevation and site elevation zones layers.

lbross commented 2 years ago

I implemented the clipping for the DEM layer and we are using it in the analysis tools. There is a new version of the add-in posted on basins. Please take a look and let me know how it goes.