Monday 3 February 2020

arcgis desktop - Zonal maximum at a specific location


I have 50,000 polygon shapefile, each polygon is a small community. I have a flow accumulation raster.


I need to extract just the maximum cell (max flow accumulation) for each polygon.


Now if I run a zonal maximum it fills the polygon with the maximum flow accumulation value.


I need just the cell with the highest value returned not the entire zone.


I could do a zonal maximum and then subtract the original raster and I think all values that equal 0 would be what I want.


To be clear. I want just the cell with the highest value in each zone returned as a raster cell or even as a point (not the entire zone populated with the value).


ArcGIS solution preferred. Model Builder fine. ArcPY ok.



Answer



From Esri's support site : HowTo: Create points representing the highest or lowest elevations within polygon features



Just replace the elevation raster by the Flow Accumulation raster.




  1. Identify the value of the highest elevation within each polygon feature using the Zonal Statistics tool: Open ArcMap and navigate to ArcToolbox > Spatial Analyst Tools > Zonal > Zonal Statistics. This generates a new raster that changes all the cell values in each polygon feature to the value of the highest elevation within that polygon feature. For example purposes, name this raster 'Max_Elev.' The input and output parameters are as follows:


A. The 'Input raster or feature zone data' is the polygon feature class.


B. The 'Zone field' is a field in the polygon feature class that contains a unique value for each polygon feature, such as OBJECTID.


C. The 'Input value raster' is the DEM.


D. Select a name (Max_Elev) and location for the 'Output raster' that is generated.


E. For 'Statistics type', select 'Maximum'.



F. Make sure that 'Ignore NoData in calculations' it is checked.



  1. Compare the DEM to the Max_Elev raster to determine which cells in the DEM correspond to the highest elevation found within each polygon feature. This is done using a conditional statement in the Raster Calculator: ArcToolbox > Spatial Analyst Tools > Map Algebra Raster Calculator. The output is a raster depicting only the DEM cells with the highest elevation values and all other cells set to NoData. The input and output of the Raster Calculator is as follows:


A. Use the conditional statement: , which states that if a cell in a DEM is equal to the corresponding cell in Max_Elev, then set the cell value of the output raster to what is in DEM. If the cell value in the DEM is not equal to the value in Max_Elev, it is set to NoData in the output raster.


B. Provide a location and name for the Output Raster. For example, call this raster 'Cell_Loc'.


The output raster, Cell_Loc, may appear to not display but this is because only the cells with the highest elevations actually contain values. These cells may be barely visible until zoomed in. The remaining cells contain NoData values and therefore by default are not symbolized.




  1. Convert the Cell_Loc raster to a point feature class using the Raster to Point tool: ArcToolbax > Conversion Tools > From Raster > Raster to Point. The input and output parameters are as follows: A. The 'Input raster' is Cell_Loc. B. The 'Field' is 'Value'. This carries over the elevation value from the cell to the point feature. C. Select a name and location for the 'Output point features'.



    After the tool completes it may be necessary to change the symbology of the output point features so they are clearly visible.





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...