Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Extract by Mask Problem

$
0
0
Hi all,

I'm having a bit of trouble with using the Extract by Mask functionality. I have a Python code that creates a file GDB and then I import shapefiles to the GDB. I then create a new raster dataset within the file GDB and then mosaic 4 .tiff into it. The problem occurs when I try to 'Extract by Mask' using the new raster dataset as the input and a polygon as the mask. I get an error stating that:

'AttributeError: 'module' object has no attribute 'ExtractByMask''

I have imported the spatial analyst extension and below is the code that I'm trying to use:

Code:

# Set local variables
in_raster = "C:/Users/D/Prog_Assign.gdb/R_Dataset"
in_mask_data = "C:/Users/D/Prog_Assign.gdb/Study_area_extent_shp"
#Extract by Mask
arcpy.ExtractByMask (in_raster, in_mask_data)
# Save the output
outExtractByMask.save("C:/Users/D/Prog_Assign.gdb/T_Mask")

Any help or advice would be greatly appreciated!

Viewing all articles
Browse latest Browse all 2485

Trending Articles