Pixel Types

298
3
Jump to solution
01-03-2013 08:41 AM
MatthiasWoerner
New Contributor III
Dear all,

there is a raster layer I would like to convert to polygons witrh the tool "Raster To Polygon". But that doesn't work. If I got it right the pixel type must be "integer", but in fact it is "floating point".

With the tool "Copy Raster" I wanted to change the pixel type. There are a lot of pixel types available, but several tests resulted in raster images different from the original.

How do I know which pixel type to choose and what do I have to observe to get a raster image identical to the original?

Thanks in advance and kind regards,
Matthias
0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor
Hi Matthias,

If you have 3D or Spatial Analyst, use the Int tool to convert the floating point raster to an integer raster.  The decimal values will be dropped from each pixel. 

If you need to maintain the decimal values, first use the Times tool and multiply the raster by a constant to preserve the number of decimals.  For example, if you need to maintain 3 decimals, multiply the raster by 1000.  Then, execute the Int tool, followed by the Raster to Polygon tool. 

Within your polygon shapefile/feature class you will have a Value field.  You can then use the field calculator to divide by the constant used for the Times tool, and you will then have the original pixel values.

View solution in original post

0 Kudos
3 Replies
JakeSkinner
Esri Esteemed Contributor
Hi Matthias,

If you have 3D or Spatial Analyst, use the Int tool to convert the floating point raster to an integer raster.  The decimal values will be dropped from each pixel. 

If you need to maintain the decimal values, first use the Times tool and multiply the raster by a constant to preserve the number of decimals.  For example, if you need to maintain 3 decimals, multiply the raster by 1000.  Then, execute the Int tool, followed by the Raster to Polygon tool. 

Within your polygon shapefile/feature class you will have a Value field.  You can then use the field calculator to divide by the constant used for the Times tool, and you will then have the original pixel values.
0 Kudos
MatthiasWoerner
New Contributor III
Dear Jake,

Thanks a lot for your quick answer and the suggestions.

Now I used the Times tool (with 100) and the Int tool. Then the Raster To Polygon tool worked.

But after this in the polygon layer there were the fields: FID, shape, ID and Gridcode. I suppose that gridcode is equivalent to the former field value (in the raster layer), but am not sure. Should the tool not maintain the original field value?

Regards,
Matthias
0 Kudos
JakeSkinner
Esri Esteemed Contributor
You are correct, the field GRIDCODE represents the former field VALUE.
0 Kudos