I have a georeferenced raster. Instead of extracting or clipping it by a clip feature or co-ordinate, I need to clip it by row and column number.
i.e. I want BX.tif to be columns 2150:2400 and rows 1250:1650 of B2.tif.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityI have a georeferenced raster. Instead of extracting or clipping it by a clip feature or co-ordinate, I need to clip it by row and column number.
i.e. I want BX.tif to be columns 2150:2400 and rows 1250:1650 of B2.tif.
Set environment extent and cell size to your raster. Go to python window and type:
>>> arcpy.gp.SingleOutputMapAlgebra_sa("$$ROWMAP + 1")
>>> arcpy.gp.SingleOutputMapAlgebra_sa("$$COLMAP + 1")
rename outputs in table of content and use field calculator:
Con(("COLS" <= 50) & ("COLS" >= 10) & ("ROWS" <= 50) & ("ROWS" >= 20),1)
Convert output to polygon and set environment extent to it. Use raster calculator to compute extract, e.g. type "DEM"
Credits go to @Luke
I addressed this using Michael Miles-Stimson's comment - in gdal
gdal_translate -srcwin 1250 2150 401 251 input.tif output.tif