[gdal-dev] gdaltindex produces absolute paths

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] gdaltindex produces absolute paths

Pedro Venâncio-2
Hi,

Some time ago I opened this bug report (http://hub.qgis.org/issues/11428), because I thought it was a problem of the implementation of gdaltindex in QGIS, but now I see that it isn't, because it also happens at the command line.

If I put the command line in the folder where the raster files are located [0], 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.

But if I reference the input raster files with the absolute paths [1] (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.

This is the desired behavior, or is it a bug?

I'm using gdal 1.11.2 (OSGeo4W), in Windows.

Thank you very much!


Best regards,
Pedro Venâncio


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

[1] 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

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: gdaltindex produces absolute paths

Even Rouault-2
Le vendredi 20 février 2015 16:36:34, Pedro Venâncio a écrit :

> Hi,
>
> Some time ago I opened this bug report (http://hub.qgis.org/issues/11428),
> because I thought it was a problem of the implementation of gdaltindex in
> QGIS, but now I see that it isn't, because it also happens at the command
> line.
>
> If I put the command line in the folder where the raster files are located
> [0], 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.
>
> But if I reference the input raster files with the absolute paths [1] (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.
>
> This is the desired behavior, or is it a bug?

Pedro,

per the usage message of gdaltindex:
"" o Raster filenames will be put in the file exactly as they are specified"
  on the commandline unless the option -write_absolute_path is used.""""

so this is at least the documented behaviour :-)

In your case, you would rather need a "-write_relative_path" that would
compute the relative path of the referenced paths with respect to the tile
index location (which can be something that could not succeed for example if
the files are on different drives on Windows)

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: gdaltindex produces absolute paths

Pedro Venâncio-2
Hi Even,

Yes, you are right! This part confused me

" raster filenames will be put in the file exactly as they are specified "

as talks in filename.


Thank you very much Even!

Best regards,
Pedro




_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev