Is there a simple way to expand the extent of an existing raster (using nodata values)?
I have explored the following:
Extending an existing raster extent.
Increasing raster extent by filling extent with no data using ArcGIS Desktop without Spatial Analyst...
And I came across another posting (sorry, the link is not readily coming up) in which someone (Dan Patterson I think) recommended combining the starting (small) raster, and overlaying with another larger raster. Makes sense, and I have run the following:
# Expand the size of the data raster, using a NoData raster of the correct extent.
emptyraster = Raster("examplerasterofdesiredsize") # Make a copy of a raster that is of the correct size
emptyraster = SetNull("examplerasterofdesiredsize","examplerasterofdesiredsize","VALUE = 0") # The raster being used is already populated with the value 0, this is converted to NoData
emptyraster.save("emptyraster") # save the no data raster
So far so good.
outputraster = Con("smallraster","smallraster","emptyraster") # Where there is a value for the small raster, use it, otherwise use the value from the larger raster
outputraster.save("outputraster")
Unfortunatly, the outputraster retains the same extent as the small raster. There are ways to change this going through the GUI menus, but I would rather automate the process.
Should the Con function work? Thanks.