GM Scripting syntax problem

ejomalleejomalle Global Mapper UserPosts: 2
edited August 2008 in Technical Support
I am just starting out using the GM scripting language and I am attempting to write a batch file to perform some simple math on a couple of elevation grid files, but I keep getting an error. Perhaps someone out there can provide some sample scripts doing something similar using Combine Terrain or at least set me on the right course.

A portion of my script looks like this:

IMPORT FILENAME="C:\Aberdeen_PG\1st_Return_XYZ\IMG2\w0010 01_1-1r1.IMG"
IMPORT FILENAME="C:\Aberdeen_PG\Bare_Earth_XYZ\IMG\w00100 1_1-1c4.IMG"
//
//
COMBINE_TERRAIN
LAYER1_FILENAME="C:\Aberdeen_PG\1st_Return_XYZ\IMG 2\w001001_1-1r1.IMG"
LAYER2_FILENAME="C:\Aberdeen_PG\Bare_Earth_XYZ\IMG \w001001_1-1c4.IMG"
COMBINE_OP=SUBTRACT_SIGNED
LAYER_DESC=Difference_Layer
ELEV_UNITS=FEET
UNLOAD_LAYER="C:\Aberdeen_PG\1st_Return_XYZ\IMG2\w 001001_1-1r1.IMG"
UNLOAD_LAYER="C:\Aberdeen_PG\Bare_Earth_XYZ\IMG\w0 01001_1-1c4.IMG"
//
EXPORT_RASTER FILENAME="C:\Aberdeen_PG\Diff\Dif_1-1.IMG"

The error received:

Combining Terrain Layers to new layer: Combined Elevation Grid...
WARNING: Missing LAYER1_FILENAME parameter for UNLOAD_LAYER command.
WARNING: Unknown command <LAYER1_FILENAME="C:\Aberdeen_PG\1st_Return_XYZ\IM G2\w001001_1-1r1.IMG"> ignored.
WARNING: Unknown command <LAYER2_FILENAME="C:\Aberdeen_PG\Bare_Earth_XYZ\IM G\w001001_1-1c4.IMG"> ignored.
WARNING: Unknown command <COMBINE_OP=SUBTRACT_SIGNED> ignored.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited August 2008
    If you are going to continue a single script onto multiple lines you need to include a line continuation character (\) at the end of each line. The syntax of your UNLOAD_LAYER commands was also incorrect. Here is what your script should look like:

    IMPORT FILENAME="C:\Aberdeen_PG\1st_Return_XYZ\IMG2\w0010 01_1-1r1.IMG"
    IMPORT FILENAME="C:\Aberdeen_PG\Bare_Earth_XYZ\IMG\w00100 1_1-1c4.IMG"
    //
    //
    COMBINE_TERRAIN \
    LAYER1_FILENAME="C:\Aberdeen_PG\1st_Return_XYZ\IMG 2\w001001_1-1r1.IMG" \
    LAYER2_FILENAME="C:\Aberdeen_PG\Bare_Earth_XYZ\IMG \w001001_1-1c4.IMG" \
    COMBINE_OP=SUBTRACT_SIGNED \
    LAYER_DESC=Difference_Layer \
    ELEV_UNITS=FEET
    UNLOAD_LAYER FILENAME="C:\Aberdeen_PG\1st_Return_XYZ\IMG2\w 001001_1-1r1.IMG"
    UNLOAD_LAYER FILENAME="C:\Aberdeen_PG\Bare_Earth_XYZ\IMG\w0 01001_1-1c4.IMG"
    //
    EXPORT_RASTER FILENAME="C:\Aberdeen_PG\Diff\Dif_1-1.IMG"

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.