Can IMPORT handle wildcards?
kbellis
Global Mapper UserTrusted User
I tried using the following line in a little script:
no can find.PNG
There's a little twist on this (and shouldn't matter I think); the script is being called from within a .bat - plenty of places for me to make mistakes! However, it didn't seem to matter, it failed from both the running of the .bat AND running just the script from an open GM session.
The full .bat and .gms:
Thank you for any pointers,
Kelly
IMPORT FILENAME="c:\mcctests\data\*.las"which resulted in this error message:
no can find.PNG
There's a little twist on this (and shouldn't matter I think); the script is being called from within a .bat - plenty of places for me to make mistakes! However, it didn't seem to matter, it failed from both the running of the .bat AND running just the script from an open GM session.
The full .bat and .gms:
[B]meta09.gms[/B] GLOBAL_MAPPER_SCRIPT VERSION=1.00 // Saturday, October 12, 2013, 4:30 PM, VKB - Filtered Export Scripting - Is It Possible? IMPORT FILENAME="c:\mcctests\data\*.las" TYPE="LIDAR_LAS" ELEV_UNITS="METERS" \ LABEL_FIELD_FORCE_OVERWRITE="NO" LOAD_FLAGS="1048576,6.000,0,2~0~0~0~0~0~0~0,,4294967295,0.00,5.00,1" \ LIDAR_DRAW_MODE="ELEV" LIDAR_POINT_SIZE="0" LIDAR_DRAW_QUALITY="50" SAMPLING_METHOD="NEAREST_NEIGHBOR" \ AUTO_CONTRAST="NO" CONTRAST_SHARED="YES" CONTRAST_MODE="NONE" CLIP_COLLAR="NONE" \ TEXTURE_MAP="NO" EXPORT_METADATA FILENAME="*.las" METADATA_FILENAME="C:\MCC-LIDAR experiments\examinations\Baseline\stats001.txt"
[B]gm_meta01.bat[/B] @ECHO off echo Adding global_mapper folder to PATH environment variable... PATH="C:\Program Files\GlobalMapper15_64bit";%PATH% global_mapper "C:\MCC-LIDAR experiments\meta09.gms" PAUSE
Thank you for any pointers,
Kelly
Comments
-
Kelly,
Either use IMPORT within a loop--DEFINE_VAR NAME="INPUT" VALUE="[I]path[/I]" ... DIR_LOOP_START \ DIRECTORY="%INPUT%" \ FILENAME_MASKS="*.LAS" \ RECURSE_DIR=NO IMPORT \ FILENAME="%FNAME_W_DIR%" \ TYPE=LIDAR_LAS \ ... DIR_LOOP_END
or use IMPORT_DIR_TREE.
Tim -
Is path implied to be spelled out like:
DEFINE_VAR NAME="INPUT" VALUE="c:\mcctests\data"
or instead intended to be literal:DEFINE_VAR NAME="INPUT" VALUE="path"
-
You would put your path in there, or you can just use IMPORT_DIR_TREE instead, you don't have to use a variable, but it could be handy for re-using scripts.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Global Mapper -
I probably complicated things by including a variable for the folder name in the loop example, sorry. The path in italics needs replacing with an actual path.
But variables are a good and worthwhile habit! Apart from the obvious joy of building on what has previously worked, writing scripts for reuse makes debugging them much easier. -
I'm on board with your logic Tim - thank you both very much for the help
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