POST
|
Hi Rob, This is Noman from the Spatial Analyst Team from Esri. I would be more than happy to discuss the workflow with you. Your description mentions a script, but I did not notice any attachment. Can you please attach the script or post the code so that I can understand the workflow and the issue better? Thanks Noman
... View more
03-23-2022
10:43 AM
|
0
|
1
|
383
|
POST
|
Hi Daniel, You should be able to extract a raster using the Extract by Mask tool. You are accepting the default cell size which is probably resulting in a large raster dataset. I understand you have specified the Processing Extent Geoprocessing Environment while running the tool. Can you also please try to specify a larger Cell Size in the environment to see if the tool runs faster and create a smaller output? Please specify both the Processing extent and the Cell Size. If the tool extracts the raster correctly, you can calculate the size of the raster for the larger cell size by multiplying the number of rows with the number of columns. Once you know the number of rows and columns for the larger cell size, you can also estimate the number of rows, columns, and size of the raster as well as the download time for the default or smaller cell size. Please let us know if you still notice a discrepancy. Thanks Noman Nawajish Noman, Esri
... View more
09-15-2021
11:02 PM
|
0
|
1
|
8053
|
POST
|
Hi Mohamad, I am glad it is working for you. Is it possible for you to share the data with me so that we can test and see why you missed a few streams with a small threshold value? Thanks Noman
... View more
07-12-2021
11:28 AM
|
0
|
1
|
2229
|
POST
|
Hi Mohamad, Can you please specify a numeric value 1 (or any number) in the false raster parameter instead of the flow accumulation raster? The stream raster from Con or Set Null does not need the flow accumulation values. It can just be one value. Steam Link will assign unique values to each reach. Thanks Noman
... View more
07-12-2021
10:03 AM
|
1
|
1
|
2247
|
POST
|
Hi Mohamad, Could you kindly post the expression you used in the Set Null tool? I usually use the Con tool to apply a threshold to flow accumulation raster to create a stream raster, which I then use to Stream Link tool. You can try the Con tool instead of the Set Null to see if it helps. If nothing works, I would be interested to get your data for taking a closer look if you can share. Thanks Noman
... View more
07-12-2021
09:06 AM
|
0
|
3
|
2276
|
POST
|
Hi Deepa, If I understand your inputs and analysis objective correctly, you can do this easily using the following workflow. You don't need to create numpy arrays or use any other python package. Please make sure to use the correct formula for calculating skewness in the map algebra expression below. Thanks Noman Nawajish Noman, PhD Sr. Principal Product Engineer, Product Engineering Lead Esri, Redlands, CA. Calculating Pearson's second skewness coefficient (median skewness) Input: 10 single band rasters or 1 multiband raster with 10 bands Steps (using Spatial Analyst tools and operators) Run CellStatistics 3 times to create mean, median, and standard deviation outputs as cs_mean, cs_median, cs_stddev respectively. Execute the following map algebra expression in Raster Calculator or in Python using arcpy.sa molule. out_skewness = 3 * (cs_mean – cs_median) / cs_stddev
... View more
03-31-2021
04:34 PM
|
1
|
0
|
2587
|
POST
|
Hi Cami, If your hourly rasters are named sequentially as ih1.tif, ih2.tif, ih3.tif, etc. and you want to create cumulative rainfall rasters CumRain1.tif, CumRain2.tif, CumRain3.tif, etc. where conceptually: CumRain1.tif = ih1.tif CumRain2.tif = CumRain1.tif + ih2.tif CumRain3.tif = CumRain2.tif + ih3.tif and so on... You can do it using a few simple steps: 1. Copy the first hourly rainfall raster to the first cumulative rainfall raster 2. loop through from 2nd hourly rainfall raster to the last hourly rainfall raster 3. for each hour create a cumulative rainfall raster by adding the hourly rainfall raster to the previous cumulative rainfall raster. Please see the code snippet below. Please note you can also use the Cell Statistics tool to add many rasters using the SUM option. Hope it helps. Please let me know if you have any questions. Thanks Noman #Code Snippet import os import sys import arcpy from arcpy.sa import * #Input, Scratch, and Output Workspace current_path = os.path.dirname(__file__) data_folder = os.path.join(current_path, 'data') out_folder = os.path.join(current_path, 'output') scratch_folder = os.path.join(current_path, 'scratch') #Geoprocessing environmnet arcpy.env.scratchWorkspace = scratch_folder arcpy.env.workspace = out_folder arcpy.env.overwriteOutput = True #Checkout Spatial Analyst extenson arcpy.CheckOutExtension("spatial") #Copy 1st hourly rainfall to 1st cumulative rainfall. firstHourlyRainfallRasterName = "ih"+str(1)+".tif" firstHourlyRainfallRaster = os.path.join(data_folder, firstHourlyRainfallRasterName) firstCumulativeRainfallRasterName = "CumRain"+str(1)+".tif" firstCumulativeRainfallRaster = os.path.join(out_folder, firstCumulativeRainfallRasterName) arcpy.management.CopyRaster(firstHourlyRainfallRaster, firstCumulativeRainfallRaster) #Loop through 2nd to last (10th) hourly rainfall. for i in range(2, 11): #Specifying input and output raster PreviousCumulativeRainfallRasterName = "CumRain"+str(i-1)+".tif" PreviousCumulativeRainfallRaster = os.path.join(out_folder, PreviousCumulativeRainfallRasterName) hourlyRainfallRasterName = "ih"+str(i)+".tif" hourlyRainfallRaster = os.path.join(data_folder, hourlyRainfallRasterName) cumulativeRainfallRasterName = "CumRain"+str(i)+".tif" cumulativeRainfallRaster = os.path.join(out_folder, cumulativeRainfallRasterName) #adding hourly rainfall raster with previous cummulative rainfall raster CumRain = Raster(PreviousCumulativeRainfallRaster) + Raster(hourlyRainfallRaster) CumRain.save(cumulativeRainfallRaster)
... View more
12-15-2020
10:20 PM
|
0
|
0
|
2082
|
POST
|
Hi Lukas, I think you articulated the difference pretty well. I think in the Surface Volume tool, one surface is flat and represented by a constant value where as in the Cut Fill tool both inputs are surface (raster input) is the key difference. Other minor differences are (1) in the Cut Fill tool, the order of the input surfaces defines the notion of cut area or fill area whether as in the Surface Volume tool there is a parameter to define where is computation happening, above or below the flat surface, (2) The Surface Volume tool supports TIN and Terrain as inputs where Cut Fill only takes raster as input. I am sure there are quite a few differences. Hope it helps! Thanks! Noman Redlands, Esri, CA
... View more
04-23-2020
01:16 PM
|
0
|
0
|
1302
|
POST
|
Hi Isaac, I am glad that it is now working for you. I will try to make some comments regarding your question, "I will like to now add to my initial question on an appropriate cell size if my grids are 1 km X 1 km and my land use (vector) are as detailed as that of open street map." It's the classic analysis challenge of combining raster and features together in a raster analysis, where features are internally converted to a raster before performing the analysis. The analysis cell size and the cell alignment (controlled by the Snap Raster environment setting) become the key factors and the accuracy of the output depends on them. So what's the appropriate appropriate cell size? It depends.... If you have two raster of different cell sizes, we use the larger cell size as the default because by using the smaller cell size, we will be creating data for the other raster that does not exist. The flip side is, by using larger cell size, we may lose the data that exists in the higher resolution raster. So, we take an analytically conservative approach with a larger cell size as the default, but as the analyst, you can control the cell size and specify a size that suits your analytical need. If you have a raster and a feature class as inputs, the first approach might be to use the cell size of the raster for analysis. And use the input raster and the snap raster as well. However, if the cell size does not capture the details presented in the features (think features to raster conversion), you may want to make the cell size smaller. A blog written by one of my colleagues about Zonal Statistics will shade some light on the process of internal conversion of a feature to a raster for raster analysis and the effect on the output. Getting the most out of Zonal Statistics Hope it helps! Thanks Noman Esri, Redlands, CA
... View more
04-23-2020
12:59 PM
|
0
|
0
|
1310
|
POST
|
Hi Isaac, For some reason the image you uploaded is not displaying. It would good to see the overlay of your land use and grid of multiple classes. Please also mention the cell sizes of your inputs and if you set any environment such as extent, cell size, snap raster and output coordinate system while running the tool. Thanks Noman Esri, Redlands, CA
... View more
04-23-2020
10:05 AM
|
0
|
2
|
1310
|
POST
|
Hi Johannes, Thanks for clarifying your analysis objectives. I will try to outline a few steps, where some are required and some other might be optional. Since there are many different ways to approach each step, I will just pick one, however, you can decide to do run some other tool to find the same final answer. I am still not clear why you want to change the resolution of your DEM, so for the moment I will put it aside and approach this analysis with the original data. And then we will come back to changing the resolution if needed. 1. Smoothing out the DEM to remove small errors If you are worried about the accuracy of the data and want to smooth it out, you can use the Filter tool with the 'Low pass' option. If you want more control over the neighborhood, you can use the Focal Statistics too. 2. Removing small sinks Since you are interested in larger sinks, surface area more that 5000 sq.m, you may decide to remove some sinks at this early stage of analysis. You can do this by running the Fill tool with a z-limit. The z-limit specifies the maximum difference allowed between the depth of a sink and the pour point and determines which sinks will be filled and which will remain untouched. The z-limit is not the maximum depth to which a sink will be filled. Choosing an appropriate z-limit could be tricky when your criteria is the surface area of a sink. However, since you are looking at rewetting and dam, I am sure you have a depth of the sink in consideration below which the sink is not worth considering. So, you can easily use that depth to weed out some sinks. Let's call this filled (with z-limit) DEM as FilledDEMwithZLimit. We will use this DEM for further analysis. 3. Identify remaining sinks Now it's time to identify the remaining sinks in FilledDEMwithZLimit. Run the Fill tool using the D8 option and then run the Sink tool. The output from the Sink tool will contain all remaining sinks. Let's call this output AllSinks. Please make sure the output AllSinks has the raster attribute table. If not, please use the Build Raster Attribute Table tool to create the attribute table. 4. Identify sinks larger than 5000 sq.m. There are many ways to approach this step. I will start with a very simple approach. We will just look at the COUNT field in the raster attribute table of AllSinks to look for sinks that meets your criteria. You said your DEM cell size is 30cm. So, any sink with a cell count of (5000 / (0.3 * 0.3)) = 55,556 will meet your criteria. You can look at the raster attribute table of AllSinks, select rows where COUNT is equal to or greater than 55,556. These are the sinks meet your criteria. An alternative approach is to run Zonal Geometry As Table to find out which sinks meet your criteria. The good part is, from the output of Zonal Geometry As Table you will not only get the area, you will have some additional information about the shape and location of the sinks that meet your criteria. 5. Finding the total sink area for the sinks meet your criteria You can use the Summary Statistics tool to do this task. You can use the AllSinks, select the rows that meet the criteria, run the Summary Statistics tool and find Sum on the COUNT field. You can multiply the sum of COUNT by (cellsize * cellsize) to find the total area. Alternatively you can use the output from Zonal Geometry As Table , select the rows that meet the criteria, run the Summary Statistics tool and find Sum on the AREA field. An alternate approach Please note, there are many ways we can come to the same result. One of the interesting approach could be to to run Fill without the z-limit using FilledDEMwithZLimit as input. Let's call this output as FilledDEM. Then use the Cut Fill tool to find the area and volume of each sink. You can then select your sinks by applying the criteria of the Cut Fill output. And then of course run the Summary Statistics tool to find the total area. Changing the resolution of the DEM Now that we have discussed the steps for fining your sinks and calculating the total area, let's go back to the DEM resolution question. I am still not sure why you need to lower the resolution of the DEM if your computer can process all the steps with the original high resolution DEM within reasonable time. If you still think it is necessary to lower the resolution of your DEM, you can run the Resample tool. In my opinion, you can do it either before step 1 or after. But before you run any fill operation in step 2. Hope this help! Please let me know if you have any additional questions. Thanks! Noman Esri, Redlands, CA
... View more
04-09-2020
09:57 PM
|
0
|
0
|
2515
|
POST
|
Hi Kyle, Thanks for your reply. What is the version of the ArcGIS are you using? Is it possible to share your data with me? Can you post the statistics and histogram of your input data? And your input data type (integer, float, double) as well? What is the format of your input and output raster dataset? I am sorry if the tool is creating incorrect output. Hopefully we will get to the bottom of this problem. Thanks Noman
... View more
04-09-2020
04:20 PM
|
0
|
1
|
1574
|
POST
|
Hi Kyle, We need to understand if the output from the tool is wrong or having display problem. Can you please check the statistics of the RescaleByFunction output from layer property? Are you using ArcGIS Pro or in ArcMap? If in Pro, if the statistics looks good, can you please click on the DRA on the Raster Layer/Appearance ribbon to see if it improves your display? Thanks, Noman Esri, Redlands, CA.
... View more
04-09-2020
01:50 PM
|
0
|
4
|
1574
|
POST
|
Hi Joe, You can also write a complex Con statement as follows: mySlope = Raster(“mySlope.tif”) mySlopeClasses = Con(mySlope <= 25, 1, Con(((mySlope > 25) & (mySlope <=35)), 2, 3)) mySlopeClasses.save(“mySlopeClasses.tif”) Here is a blog on the Con tool you might find useful - Performing analysis with the Con tool Thanks Noman Esri, Redlands, CA.
... View more
04-08-2020
02:35 PM
|
1
|
0
|
1835
|
POST
|
Hi Johannes, I am trying to understand your analysis requirements from you statement, "I'm searching for areas for rewetting, so my intentions is to get some aggregated areas where it's worth to try build barriers to dam the water." Are you trying to identify all sinks or sinks larger than a certain depth or area or volume? What do you mean by, "to get some aggregated areas"? Do you want the total areas of all available sinks that meet certain criteria? What is the purpose of changing the resolution of your DEM by resampling? Just as a side note, Once you run Fill on a DEM without a Z-Limit all sinks get filled. Once you resample (using bilinear), it is possible a new sink could get created because of how the elevation is recalculated for each cell. If you want to change the resolution of your DEM, You probably want to resample before you run any hydrology tool such as Fill, FlowDirection etc. Also chose the resampling technique (nearest neighbor or bilinear) based on your application. Bilinear will smooth out your DEM, which may change the flow direction. Aggregate tool generates a reduced-resolution version of a raster. Each output cell contains the Sum, Minimum, Maximum, Mean, or Median of the input cells that are encompassed by the extent of that cell. If you are just looking for the total area of all sinks/depressions, you can just look at the count field in the Raster Attribute Table and multiply with cellsize*cellsize to get the area in map units. You can also use tool like Zonal Geometry, Zonal Geometry As Table, Zonal Statistics, Zonal Statistics As Table depending on your application. One last thing, you may consider running Spatial Analyst tools using the ArcPy sa module. Your output will be on the left hand side and all intermediate data will be temporary and will be deleted by the system. You can just save the final output. If you write a complex map algebra expression, it will be optimized and efficient as well. Thanks, Noman Esri, Redlans, CA
... View more
04-08-2020
12:33 PM
|
1
|
2
|
2515
|
Title | Kudos | Posted |
---|---|---|
1 | 03-31-2021 04:34 PM | |
1 | 07-12-2021 10:03 AM | |
1 | 02-12-2018 09:47 PM | |
1 | 02-06-2018 12:01 AM | |
1 | 04-08-2020 12:33 PM |
Online Status |
Offline
|
Date Last Visited |
03-23-2022
08:34 PM
|