[GIS] Convert raster to a CSV values and lat long based on raster value in ArcGIS

arcgis-desktopvectorization

I am looking to convert a raster into a csv file (or tab delimited) based on values in the raster (Value > 0).

The csv would have three values, latitude of center of cell, longitude of center of cell, and the raster value where the raster value is greater than 0.

The data in unprojected in geographic coordinate system WGS 1984. It is a GTiff.

I know I can go to point file and then add the latitude and longitude and then go to CSV but I wonder if a direct method exists as I have 130 million points.

Working on going Ras > Point (file Geodatabase) > Query Points > CSV in ArcGIS but it is slow.

I feel I need to build in the query at the Ras > Point section to speed things up as the entire raster has 130 billion cells but only 130 million have values. Rest are 0 or NoData.

Looking for ArcGIS solution.

Best Answer

You can use the Sample tool to generate a table of X,Y,Z values:

Creates a table that shows the values of cells from a raster, or set of rasters, for defined locations. The locations are defined by raster cells or by a set of points.

Use the same raster as both the input and location dataset.

The tool will output a DBF or a GDB Table which you can then export to CSV.


Alternatively, see this answer for a non ArcGIS method that uses GDAL and doesn't include NoData values in the output.