I'm using ArcGIS 10.4 and want to export XYZ values of a raster (type: GRID) to a text file. I'm following the procedure recommended by ESRI support. However, it seems that the Sample Tool in spatial analyst toolbox skips a bunch of points. When I display the XY-Data certain rows and points are incorrect, either 0 or -9999 (not displayed).

Results from sample tool: -9999 not displayed

I tried this with different input data, and i cannot find an explanation at all. I thought this might be because of the ArcGIS instance i was runnning, but I tried the sample tool in an freshly started ArcCatalog window. Almost the same happens there, just that the points are not 100% identically.

Results from sample tool, different instance

Is this a bug, or am I doing something completely wrong? How do I fix this?

It seems to be related to this question from 3 years ago.

Edit: Several new tries (see suggestions below), resulting in different patterns. Could still not find the solution to this problem. Another screenshot with nearly the same area, different zoom, different color scale. -9999 is bright yellow, 0 is dark color.

same area, different view, different color scale. -9999 is bright yellow, 0 is dark color

  • Does the same problem occur when using (or not using) background geoprocessing? Sep 7, 2016 at 16:36
  • I've been using background processing so far. Tested it just now with foreground processing, same error, same line. It seems that ArcGIS skips a line every 30 lines (width at this location is 1200 rows, but this varies).
    – Markus
    Sep 8, 2016 at 8:25
  • What is your processing extent?
    – GISGe
    Sep 12, 2016 at 8:53
  • Processing extent is default and corresponds to ETRS89 32N 418600m - 509100m E 5877800m - 6000000m N. Cellsize 25m. Changing this to the raster extent does not work either.
    – Markus
    Sep 12, 2016 at 9:21
  • What happens if you select the points giving an erroneous result and then run the spatial sample on only those points?
    – AnserGIS
    Sep 15, 2016 at 8:58

1 Answer 1


It turns out the problem roots in the raster (based on the comments), though the underlying reason for the problem still remains unknown. Try to run raster calculator without any function on your entire raster to produce a new raster and then use the Sample tool.

Other useful information on the issue at hand:

As per Sample tool documentation:

Locations that sample NoData cells in the input raster or rasters will be given a value in an output geodatabase table. For output to INFO or .dbf, since the concept of null is not supported, a value of 0 (zero) will be given.

Therefore the zero value may roots in NoData cells.

A few suggestions:

  1. Change the raster format to a format other than GRID
  2. Make sure the input raster coordinate system and Output Coordinate System environment variable are the same, i.e. no coordinate transformation happens
  3. Make sure the Cell Size environment variable and input raster cell size are in agreement too.

Unfortunately The Sample tool is not a python tool, thus the source code could not be seen that on what condition -9999 values are produced!

  • Thanks for the suggestions. There are no NoData cells nearby (next 5km away). The pattern in that particular area is not affected by the NoData cells. 1) I tried the tiff-format, similiar errors, same lines, different pattern (see new screenshot above) 2+3) I tried your suggestions, unfortunately no improvements.
    – Markus
    Sep 14, 2016 at 14:51
  • I am eager to test your clipped raster (for the buggy area) on my 10.2.2 ArcGIS! Sep 14, 2016 at 15:15
  • I split the raster into 4 equal parts. The error is not reproducible any more. Is there a limit in raster size for the Sample tool? Quite often I noticed that the sample tool will simply not work, when the raster is too big.
    – Markus
    Sep 15, 2016 at 9:42
  • I doubt it if there is a limit for the raster size. Non is indicated in the doc! Try to run raster calculator without any function on your entire raster to produce a new raster and see if it works. I think there is something wrong with the raster! Sep 15, 2016 at 12:24
  • Okay, i used the Raster Calculator, saved the output in the Default.gdb, Sample Tool kept crashing (this info may not be relevant). Used it again, saved the output outside of gdb, Sample Tool took some time, but now it is working! No pattern, all values look reasonable. Can you imaging what was wrong with the raster? It originated from Mosaic to new Raster tool with different cell size input. Please update your answer, then i will mark it as correct. Many thanks!
    – Markus
    Sep 15, 2016 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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