Quantcast
Channel: Question and Answer » gdal
Viewing all articles
Browse latest Browse all 397

Read large raster into lat/lon value pair to csv file using python and/or gdal?

$
0
0

I have rasters for all of the states in US and they are in 10m resolution. So they can be very large, containing a large number of pixels if you think of TX or AK. I want to create a csv file with each line representing the lat/lon value of the pixel, with comma separating lat and lon. So far the methods that I have tried for MN state:

  1. gdal2xyz—-running time is reasonable, but there is extra column for z value in the csv file. I need to later delete this column through code.

  2. iterate each pixel in the raster, get it’s lat and lon, and write the value into csv—really takes a long time…

To sum up, I just want a csv file with the lat/lon value pair from raster. I feel like it is not hard to achieve. It is just the matter of the running time. I hope there could be some work around. Thank you.


Viewing all articles
Browse latest Browse all 397

Trending Articles