Hello everybody,
I have two questions about rasters:
1- I created a raster doing some operation with rasters using python. I used a raster of 200 x 200 meters of cell size. Once I got the final raster, when I chech its properties the cell size is 1x1. What does it mean?? Is the final raster 1x1 m o 200x200 m??
2- When I am doing the python code I define a raster projection (In this case ED 50 Zone 31) but when I load to arcgis It is not the same with other layers with this projection. I am trying to project the spatial reference, but it does not work... Any help???
Thank you for your attention!
Actually, the Python place is meant for using Python in the ArcGIS Platform. If you would like to use ArcGIS your could use something like this (will require ArcGIS and Spatial Analyst extension, see Focal Statistics—Help | ArcGIS for Desktop 😞
import arcpy import os from arcpy.sa import * ws = r"path to the folder were the TIFF files reside" ras_name_in = "MDT200-TARRAGONA-H311.tif" ras_name_out = "resultRasterTarragona.tif" ras_in = arcpy.Raster(os.path.join(ws, ras_name_in)) arcpy.CheckOutExtension("Spatial") ras_sum = FocalStatistics(ras_in, NbrRectangle(3, 3, "CELL"), "SUM", "DATA") # please note that less than and greater than may level each other out ras_out = (ras_sum - ras_in) - (ras_in * 8) ras_out.save(os.path.join(ws, ras_name_out)) # maybe you're just interested in the standard deviation (STD) arcpy.CheckInExtension("Spatial")
For non ArcGIS solutions you can better post your question elsewhere.
These links are related
Terrain Ruggedness Index Phyton code
The advice there about using ArcGIS functionality also applies here
thanks for the help. I will try it.
cheers!