Extract by Mask Tool Changes Raster Pixel Type

2115
4
03-08-2017 09:41 AM
by Anonymous User
Not applicable

I'm running the Extract by Mask tool in a model that extracts an integer land cover raster to a smaller file inside a file geodatabase. The output raster's Value field changes to double, creating a problem for the following Raster to Polygon tool that only convert integers or strings. I have a string field to use as a workaround and I will try writing the extracted raster to a location outside a file gdb, but I'd like to know why this happens. I appreciate any help you can offer.

Tags (2)
0 Kudos
4 Replies
DanPatterson_Retired
MVP Emeritus

Well, according to the help this isn't possible, so can you provide some information on the file being used in the extraction, the range of values within it, etc.  since upscaling shouldn't be possible, but since you are using modelbuilder, I can't comment on what it may introduce.  You should also confirm that if you do the process manually with the tools in arctoolbox, that it produces the correct results.  When running those tools, pay particular attention to the Environments tab of each tool to ensure what the raster properties are, and whether they remain the same throughout the workflow.

0 Kudos
by Anonymous User
Not applicable

I understand the help says "If the input raster is integer, the output raster will be integer. If the input is floating point, the output will be floating point."  That's why this so puzzling. The original land cover values, 1-7 integer, are unchanged in the output raster but the pixel type storing these values changes to double. Extract by Mask doesn't appear to have an environment setting that would cause this. LZ77 is the default compression and it works "for all types of raster data" according to the help.

Further testing shows that our Citrix 10.2.2 ArcMap is the only place this is happening.  I also noticed that 10.2.2 doesn't apply symbology using the red, green, blue values in the attribute table of the land cover raster, whereas ArcMap 10.4 local installation does.  

DanPatterson_Retired
MVP Emeritus

given the input range is only 1 to 7, it doesn't seem that scaling is an issue (ie no stretch in the original), and you have narrowed itt down to Citrix and/or 10.2.2.  Which sadly would leave you scrolling through the 'issues resolved' documentation for each version from 10.2 to 10.5 to see if the issue was noted before.  I couldn't find any combination of keywords on Support that noted that environment or extract by mask as producing a bug.  But, issues don't seem to make it to that list unless they are numerous.  So your options are limited to resolve the issues on your other machine but at least you have a work around on the locally installed machine until you can track down the issue.  I have a list of 'issues reolved' on my blog, the Py Links  if you want to check the possibility it was a small issue/bug and if it had been resolved with a software upgrade.  Good luck and post if you find a solution.

0 Kudos
curtvprice
MVP Esteemed Contributor

You can always enforce the output to be integer by passing the output through the Int tool. This would unfortunately drop your string field from your raster but you could add it back (only if you need it) using the Join Field tool.

0 Kudos