1

I have a CSV file of depth values that have no spatial information. I know the "cell size" of the data but not where it should be put in space.

How do I convert this into a data format, such as tif, that I can import to ArcGIS Desktop to georeference as though it is an image?

  • 1
    @pythonNovice, do you have at least any spatial information or locations of your data, of course besides z-values? – Taras Aug 9 '18 at 6:59
  • 2
    Could you show us (part of) this file so we can see what the exact format is? – Berend Aug 9 '18 at 7:07
3

You can use numpy's genfromtxt to create a numpy array and then convert this to a raster using NumpyArrayToRaster.

Example:

from numpy import genfromtxt
import arcpy

my_data = genfromtxt(r'C:\folder\depths.csv', delimiter=',') #If you have a header, add skip_header=1
myRaster = arcpy.NumPyArrayToRaster(in_array=my_data, x_cell_size=1, y_cell_size=1)
myRaster.save(r'C:\folder\raster.tif')

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.