#Import modules import os import arcpy from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension("Spatial") #Set local variables wks = arcpy.GetParameterAsText(0) # input workspace inRaster1 = arcpy.GetParameterAsText(1) # input raster layer inRaster2 = arcpy.GetParameterAsText(2) # input raster layer inRaster3 = arcpy.GetParameterAsText(3) # input raster layer inRaster4 = arcpy.GetParameterAsText(4) # input raster layer inRaster5 = arcpy.GetParameterAsText(5) # input raster layer inRaster6 = arcpy.GetParameterAsText(6) # input raster layer inRaster7 = arcpy.GetParameterAsText(7) # input raster layer inRaster8 = arcpy.GetParameterAsText(8) # input raster layer inRaster9 = arcpy.GetParameterAsText(9) # input raster layer inRaster10 = arcpy.GetParameterAsText(10) # input raster layer env.workspace = wks cellSize = 100 outExtent = Extent(871599.89, 982834.44, 912502.09, 1070920.9) ReMapTable_dbf = "P:\\Crime_Analysis\\Testing_Training\\RiskTerrainModeling\\RobinAdrienne\\AggAssaults\\ReMapTable.dbf" #Multiply Raster by a constant with CreateConstantRaster constantValue1 = arcpy.GetParameterAsText(11) # input weight value outConstRaster1 = CreateConstantRaster(constantValue1, "FLOAT", cellSize, outExtent) outReclass1 = ReclassByTable(inRaster1, ReMapTable_dbf , "FROM", "TO", "VALUE", "DATA") outTimes1 = Raster(outReclass1)* outConstRaster1 outRaster1 = "Wt_" + os.path.basename(inRaster1) outTimes1.save(outRaster1) # save raster
Solved! Go to Solution.
#Multiply Raster by a constant with CreateConstantRaster constantValue1 = arcpy.GetParameterAsText(11) # input weight value outConstRaster1 = CreateConstantRaster(constantValue1, "FLOAT", cellSize, outExtent) outReclass1 = ReclassByTable(inRaster1, ReMapTable_dbf , "FROM", "TO", "VALUE", "DATA") outTimes1 = outReclass1* outConstRaster1 outRaster1 = "Wt_" + os.path.basename(inRaster1) outTimes1.save(outRaster1) # save raster
#Multiply Raster by a constant with CreateConstantRaster constantValue1 = arcpy.GetParameterAsText(11) # input weight value outConstRaster1 = CreateConstantRaster(constantValue1, "FLOAT", cellSize, outExtent) outReclass1 = ReclassByTable(inRaster1, ReMapTable_dbf , "FROM", "TO", "VALUE", "DATA") outTimes1 = outReclass1* outConstRaster1 outRaster1 = "Wt_" + os.path.basename(inRaster1) outTimes1.save(outRaster1) # save raster