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
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website