Bug report #11428

Remove the option "Write absolute path" from gdal tileindex tool

Added by Pedro Venâncio about 10 years ago. Updated about 9 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:GDAL Tools
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:19704

Description

Raster Tile Index (gdaltindex)(Raster -> Miscellaneous -> Tile Index)

always generates absolute paths, regardless of the "Write absolute path" option is selected or not.

Tested on QGIS 2.5.0-102 (OSGeo4W).


Related issues

Related to QGIS Application - Bug report #4064: gdal tileindex always write absolute path, regardless wha... Closed 2011-07-08

History

#1 Updated by Giovanni Manghi about 10 years ago

  • Status changed from Open to Feedback

does the gdal command, issued by the cli, return the correct results?

#2 Updated by Pedro Venâncio about 10 years ago

Yes Giovanni, in the cli, using -write_absolute_path generates absolute paths. Without that option, it generates relative paths. I'm with GDAL 1.11.1.

#3 Updated by Giovanni Manghi about 10 years ago

  • Status changed from Feedback to Open

#4 Updated by Jürgen Fischer about 10 years ago

  • Target version changed from Version 2.6 to Future Release - High Priority

#5 Updated by Pedro Venâncio over 9 years ago

Now I see that this isn't a QGIS problem, because it also happens at the command line.

If I put the command line in the folder where the raster files are located, gdaltindex works well, ie, with -write_absolute_path option, absolute paths are saved in the attribute table, and without -write_absolute_path option are saved only the names of files.

D:\\test\\2013\\tiff> gdaltindex -f "ESRI Shapefile" tile_index_processing_2.shp 171_2_52.tif 171_2_42.tif

But if I reference the input raster files with the absolute paths (for example, when files are in different folders), the -write_absolute_path option has no influence, because absolute paths are always recorded in the attribute table.

D:\\> gdaltindex -f "ESRI Shapefile" D:\\test\\2013\\tiff\\tile_index_processing_3.shp D:\\test\\2013\\tiff\\171_2_52.tif D:\\test\\2013\\171_2_42.tif

Like Even says here http://osgeo-org.1560.x6.nabble.com/gdal-dev-gdaltindex-produces-absolute-paths-td5188952.html

and http://www.gdal.org/gdaltindex.html

" -write_absolute_path: (...) By default the raster filenames will be put in the file exactly as they are specified on the command line. " 

Thus, unless the raster files are stored in the same folder where QGIS Raster Tile Index tool runs, we will always have the absolute path in the result.
So, do you think we should hide this option in Raster Tile Index interface?

#6 Updated by Giovanni Manghi over 9 years ago

  • Subject changed from Raster Tile Index always produces absolute paths to Remove the option "Write absolute path" from gdal tileindex tool

So, do you think we should hide this option in Raster Tile Index interface?

yes, because anyway as it is implemented in qgis the path to input files (in the command line) will be always absolute, returning always an absolute path in the index.

#7 Updated by Pedro Venâncio about 9 years ago

  • Status changed from Open to Closed

Pull request submitted to remove the "Write absolute path" option from gdal tileindex: https://github.com/qgis/QGIS/pull/2343

Also available in: Atom PDF