gdal_abs2rel_rel2abs: Convert absolute from/to relative paths in a virtual file

Description Usage Arguments Note Author(s) Examples

Description

The two functions read the content of a GDAL virtual file (VRT) and check the presence of paths to linked files.

gdal_abs2rel scans the presence of absolute paths: when an absolute path has a common parent directory with the path in which the VRT is, this is replaced with a relative. This is useful when VRT are on a remote driver, which can be mounted to several points.

gdal_rel2abs checks the presence of relative paths, and replace them with the corresponding absolute path (symbolic links are followed). This is useful to grant that VRT can be moved (if the files they link to are not moved).

Usage

1
2
3
gdal_abs2rel(in_vrt, out_vrt = NA)

gdal_rel2abs(in_vrt, out_vrt = NA)

Arguments

in_vrt

The path of the VRT to be read.

out_vrt

(optional) The path of the output VRT file (default is to overwrite in_vrt).

Note

License: GPL 3.0

Author(s)

Luigi Ranghetti, phD (2017) ranghetti.l@irea.cnr.it

Examples

1
2
3
4
5
6
7
8
## Not run: 
example_vrt <- "/TODO/example/s2_translate.vrt"
rel_vrt <- "/TODO/example/s2_translate_rel.vrt"
abs_vrt <- "/TODO/example/s2_translate_abs.vrt"
gdal_abs2rel(example_vrt, rel_vrt)
gdal_rel2abs(example_vrt, abs_vrt)

## End(Not run)

pobsteta/theia2r documentation built on May 25, 2019, 2:21 p.m.