Note:The Raster Calculator tool is intended for use in the ArcGIS Desktop application only as a GP tool dialog box or in ModelBuilder. It is not intended for use in scripting and is not available in the ArcPy Spatial Analyst module.
from arcpy.sa import * import arcpy arcpy.CheckOutExtension("Spatial") landmask=Raster(r'C:\SomeDirectory\landmask') bathymetry=Raster(r'C:\SomeDirectory\bathy') masked_bathymetry=Con(IsNull(landmask), bathymetry, 70000) masked_bathymetry.save(r'C:\SomeDirectory\maskbath')
Ftoraster3 = "Ftoraster3" FinRast_r = "finRast" # Process: Feature to Raster arcpy.FeatureToRaster_conversion(PolygonFeature, "FID", Ftoraster3, "20") # Process: Raster Calculator #arcpy.gp.RasterCalculator_sa("Con(IsNull(\"%Ftoraster3%\"),\"%idw20meter2%\", -1)", FinRast_r)
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.