I have a function that calculates a price based on the input slope and distance. I want to write the price to a raster as the rastervalue. How do I do that? OpenSource and ArcMap solutions would work.
slopeRaster = "slope.tif"
emptyRaster = "emptyraster.tif" # How do I create an empty raster?
road = "road.shp"
for cell in emptyraster:
# get slope from sloperaster at cell location
...
slope = ...
# get distance to nearest road from center of cell
...
distance = ...
# calculate price for cell
price = pricefunc(slope, distance)
# write price to cell as value # How do I write a value to a raster