New answers tagged


I ended up building a function that uses a reference image with the correct projection and extent to transform the XYZ ascii file into a GeoTiff. My ascii file had no header, so gdal_translate didn't work. Here's the function: ```def ascii_to_tiff(infile, outfile, refIm): """ Transform an XYZ ascii file without a header to a projected GeoTiff ...


If your layer is a shapefile, you can also open the *.dbf file with Excel and save it as *.xls format.


You can use Save As from the layer popup menu to save attribute table to a CSV file which can be opened by Excel.


Using the core GDAL utilities, you could easily convert your ASCII file to GTiff using gdal_translate as follows: gdal_translate -of 'GTiff' input.asc output.tiff


To convert an ASCII file with longitude, latitude and data value you may use a function like this: from osgeo import gdal def csv2tif(source, target): cvs = gdal.Open(source) if cvs is None: print 'ERROR: Unable to open %s' % source return geotiff = gdal.GetDriverByName("GTiff") if geotiff is None: print 'ERROR: ...

Top 50 recent answers are included