AnsweredAssumed Answered

Extract by mask

Question asked by geonetadmin on Oct 7, 2013
Latest reply on Oct 17, 2013 by curtvprice
Original User: dk10

Hello,
I am trying to extract cells of a raster by using the Extract by Mask option (ArcGIS 10.0 SP4 - windows 7 Pro - SP1).  I have 2 raster datasets I want to process and I am getting different results on either.  The inputs are both 3 band, 8 Bit Unsigned Integer Rasters (TIFF format), cell size 0.1 meters, No Data Value of 256 and compression = None.  When I run the extract by raster arcgis process on them, 1 comes out fine - in the same format as the input, but the 2nd one comes out as a 16-bit unsigned integer TIFF - with a No Data value of 65536.  Any thoughts or ideas on why this is?  The script below is being used to (with indents of course):

import arcpy,sys,string,os
from arcpy.sa import *
arcpy.CheckOutExtension("Spatial")

def extractds(i):
   arcpy.env.compression = "None"
   inws = "D:/Project/imageprocessing/test"
   outws = "D:/Project/imageprocessing/test"
   arcpy.env.workspace = outws
   clipds = "D:\\Project\\imageprocessing\\Data.gdb\\orthoclip"
   arcpy.env.snapRaster = inws + "\\" + str(i) + ".tif"
   if not arcpy.Exists(outws + "\\" + str(i) + "_extract.tif"):
      outextract = ExtractByMask(inws + "\\" + str(i) + ".tif",clipds)
      outextract.save(outws + "\\" + str(i) + "_extract.tif")


mylist = ['5058A','5058B']
for i in mylist:
   arcpy.AddMessage(str(i))
   extractds(i)



Screen shot of properties from input:
[ATTACH=CONFIG]28087[/ATTACH]
Screen shot of properties from output:
[ATTACH=CONFIG]28088[/ATTACH]
Thanks for any help!

Darryl Klassen

Attachments

Outcomes