Relative paths for importing
Hello,
I would like to be able to run a GM script that imports all of the files in the same folder of the script file.
For example; my script is located at C:\LIDAR\NAD_27\Geotiffs\BareEarth\script.gms
Once I load and run the script I would like to be able to import all files under the directory "C:\LIDAR\NAD_27\Geotiffs\BareEarth\
Ideally, I will be moving this script file to different folders (with same file/folder structure) and run them to execute the steps.
Changing the folder location everytime I move this script file to a new folder will not work as I am trying to automate the whole process of importing/processing LIDAR datasets.
I would appreciate any suggestions.
Thanks!
I would like to be able to run a GM script that imports all of the files in the same folder of the script file.
For example; my script is located at C:\LIDAR\NAD_27\Geotiffs\BareEarth\script.gms
Once I load and run the script I would like to be able to import all files under the directory "C:\LIDAR\NAD_27\Geotiffs\BareEarth\
Ideally, I will be moving this script file to different folders (with same file/folder structure) and run them to execute the steps.
Changing the folder location everytime I move this script file to a new folder will not work as I am trying to automate the whole process of importing/processing LIDAR datasets.
I would appreciate any suggestions.
Thanks!
Answers
-
IMPORT_DIR_TREE DIRECTORY=C:\LIDAR\Geotiffs\BareEarth
this is line I am using to load files from absolute path. -
Hello,
The scripting reference, under the command DEFINE_VAR, has a list of built-in variables, which includes:%SCRIPT_FOLDER% - inserts the full path of the running script/workspace file. This will include a trailing slash. So a script 'C:\path\my_script.gms' would get 'C:\path\' inserted
Cheers,
Bob
Categories
- 13K All Categories
- 5.8K Features Discussion
- 350 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 652 GM Script Language
- 56 User Scripts
- 115 GPS Features
- 421 Projection Questions
- 835 Raster Data
- 1.4K Vector Data
- 6.7K Support
- 181 Announcement and News
- 939 Bug Report
- 562 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 579 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 244 How I use Global Mapper
- 110 Global Mapper Forum Website

