[GIS] Converting a raster to a polygon

arcgis-desktoppolygonrasterspatial-analyst

I need to convert a raster into a polygon, and I ran into "Error 000863: Invalid GP Data Type"
After searching, I saw this solution online.
Basically I needed to convert the float raster to an integer raster. I used the times tool to multiply my raster by 1,000,000.0 to preserve all the decimal places. When I compare the resulting raster, it seems Arcgis has rounded the value for each pixel up by one (See the pixel values in the images below). I was hoping to preserve these exact values. Is there another approach I can try?

Raster before using the times tool

New raster with values rounded up by one

Best Answer

after multiplying by 10e6, you are in excess of the 32bit limit. This may explain the rounding.

On the other hand, I would look twice before I do such conversion. There is a risk to end up with to many polygons. Usually, raster solutions are more efficient in this case.

I will assume that you really have patches of identical neighbouring cell values for the following work around.

  1. Prepare your dataset (note that multiplying is not enough, you need to convert to int (e.g. in raster calculator Int(raster*100000) )

  2. Convert raster to polygon

  3. get the centroid of your polygons (e.g. feature to point)

  4. Extract value to point

  5. join the value of the point to the corresponding polygon

Related Question