COPY_LAYER_FILES

The COPY_LAYER_FILES command copies the base files for one or more layers to a new folder on disk. Support is included for maintaining folder structures if a BASE_DIR parameter is provided. If you specify layers that were loaded from .zip or .tar.gz archives, the archive file itself will be copied and not the individual extracted files. If you specify a file with supporting files with the same base name (i.e foo.tfw and foo.prj with foo.tif loaded) they will also be copied.

The following parameters are used by the COPY_LAYER_FILES command.

  • FILENAME - filename or description of layer(s) to copy the files for. This can include * and ? wildcard characters. If you leave the FILENAME parameter off then all loaded layers will have their files copied, which is the same behavior as using FILENAME="*". This parameter can be listed more than once to specify multiple input files, like FILENAME="FILENAME_1" FILENAME="FILENAME_2".
  • TARGET_DIR - specifies the folder where the files will be copied to. If no BASE_DIR parameter is provided, the files will all be copied directly to the specified folder.
  • BASE_DIR - specifies a starting string for the layer files being copied beyond which everything should be treated as relative. For exampling if copying a file at "c:\data\my_dems\colorado\denver.dem" to a TARGET_DIR of "c:\new_dems" with a BASE_DIR value of "c:\data\my_dems" you would get "c:\new_dems\colorado\denver.dem" as the new filename.
  • OVERWRITE_EXISTING - specifies that existing files should be overwritten. The default is OVERWRITE_EXISTING=YES, so use OVERWRITE_EXISTING=NO to skip files that already exist in the destination location.

SAMPLE

GLOBAL_MAPPER_SCRIPT VERSION="1.00"
/* Copy all loaded layer files to a new folder */
COPY_LAYER_FILES TARGET_DIR="C:\NEW_DEMS" BASE_DIR="c:\data\my_dems" OVERWRITE_EXISTING=YES