1

I´m trying to obtain GeoTIFF files to use them in Photoscan from ASCII files.

My process is as follows: I have 200 ASCII files more of less, I use the ASCII to raster tool in batch mode process in Arc GIS and with this I obtain an ESRI Raster, then I want to use the convert tool of QGIS to obtain the GeoTIFF.

My specific problem is I can´t save the files in other directory instead the default directory in the batch mode and that means that I can´t have the files in the right format to use it in QGIS because they are inside a geodatabase.

Probably exist other way to do what I´m trying to do but I don´t know it.

I share a sample ASCII file. enter link description here

4

You can do direct from ASCII to GeoTIFF with gdal_translate.

At its most basic you can do:gdal_translate -of GTiff input.asc output.tif

Or you can do write the output to a different folder: gdal_translate -of GTiff indir/input.asc outdir/output.tif

To batch process them in bash (on Linux) I'd do something like:

#!/bin/bash
# Create geotiffs
for f in $(ls *.asc)
  do
    echo Processing $f
    gdal_translate -of GTiff $f outdir/$f
  done
exit 0

In a Windows batch file I'd do something like:

for /f %%f in ('dir /b *.asc') do gdal_translate -of GTiff %%f outdir/%~n1.tif

or straight at the command line without the double %:

for /f %f in ('dir /b *.asc') do gdal_translate -of GTiff %f outdir/%~n1.tif
  • I'm a beginner with python, I'm going to try to do it with your advices but I was looking for an easy solution in the environment that I know. But also, thanks. – Juan Cordoba Aug 31 '17 at 22:30
  • GDAL is installed with QGIS so you can run these commands if you open the OSGeo shell and there is no Python involved at all. If you're happy with ArcGIS then the other answer has a possible solution for you too. – mixedbredie Sep 1 '17 at 9:13
  • Thanks to you I´m starting to understand the commands! Thanks a lot. My problem with QGIS is if I do the directly converstion from ASCII to GeoTIFF without the previous transformation in ArcGIS to ESRI Raster file the raster appear completely white and is impossible to align in Photoscan. – Juan Cordoba Sep 1 '17 at 14:15
  • Can you share a sample ASCII file? – mixedbredie Sep 1 '17 at 14:22
  • [link] (dropbox.com/s/vypegrtt7njx0jm/…) – Juan Cordoba Sep 1 '17 at 14:39
1

The ArcGIS docs on ASCII to Raster show that it should be possible to convert directly to GeoTIFF. You might need to use arcpy for this functionality, however.

If you are ready to use QGIS in your workflow then you should be able to bypass the ArcGIS operations and use gdal_translate (docs here) to directly convert AAIGrid data into GeoTIFFs. It would simply require a single call per input file (very much the same as ArcGIS' batch mode).

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.