I am working with ArcGIS 10 and have some tiff elevation files (NED). I can load them into Arc GIS and can look at them, and the values seem OK. I also have some shapefiles polygons and want to get the average elevation of each polygon from the tiff elevation file.

How can I accomplish this? I tried "Zonal Statistics as a Table", but I get this error:

"ERROR 000864 Input raster or feature zone data: The input is not within the defined domain. ERROR 000863: Invalid GP data type"

I thought it might be because I do not have an attribute table. So I tried to create one with "built raster attribute table", but I get an error:

"ERROR 000423 Only single band integer raster dataset is a valid input"> I do not really understand this error since I can see in Layer Properties\Source that the tiff file has only one band.

The ArcGIS help says that "It is not possible to build a raster attribute table for a raster dataset that is a pixel type of 32-bit floating point", so maybe that's the problem.

  • 1
    What statistic are you after? According to help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//… when it is floating-point type, the zonal calculations for majority, median, minority, and variety will not be computed. It's whinging that it's floating point, you can convert to Int type by using Int(Raster * Constant) where constant is 10, 100, 1000 depending on how many decimal places you want then divide the result by the same Constant factor to get back to float. Be careful when dividing statistics, sometimes they cannot be divided. – Michael Stimson Mar 17 '15 at 21:48
  • I was just using the default and estimating all the statistics ... but the mean is good enough! Thanks a lot. It worked! – Iced_ Mar 17 '15 at 22:00

Expanding on the comment left earlier, the docs for Zonal Statistics say not all statistic types are calculated for floating point rasters, for some reason the statistic type median cannot be calculated for floating point rasters... but let's go a little deeper into why not every statistic is offered:

  • Majority/Minority: almost all cells in floating point rasters are different values (to the nth decimal place) so statistics of 'the most frequently appearing' and 'the least frequently appearing' are kind of meaningless as every value is most and least appearing.
  • Variety: again, as every value is different the entire raster will have the same value in the output indicating the count of cells.
  • Median: As every cell is different there is (possibly) no statistical median/mode value in the frequency distribution.

To get around this you can convert your raster into an int type, this removes the decimal place, there are three tools that do roughly the same job: Int, Round Down and Round Up. Note Int does exactly the same thing as Round Down: truncate (remove anything after the decimal place).

Make a decision on how many decimal places are important (or significant) then multiply by a 10 based factor:

  • For 3 decimal places multiply by 1000.
  • For 1 decimal place multiply by 10
  • For 6 decimal places multiply by 1000000.
  • Not 10 based will give unpredictable results, but works just the same as long as you keep track of the number to unscale by later!

The maximum range for your integer is the same as a 32bit integer : -2,147,483,648 to 2,147,483,647 (see System.Int32), so long as your multiplied value Perform your integer function, either Up or Down, now all statistic types are available.

Now that you have your statistic you need to divide it by the same value as the original scale factor (10 or non-10 based)... but some statistics are meaningless when divided, so be careful (variety and range can't be divided).

Irrespective you will face the same problems with too many significant digits as if the raster were float values; you will need to make a decision on how to int the data and manage the scaling to achieve meaningful results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.