DEFINE_PROJ and Variables

EllieEllie Global Mapper UserPosts: 24
Hiya - I'm on v17.2, which might put me away from this post here, but if someone could run an eye over this and tell me what I am doing wrong...

I'm using the below to attempt to assign a projection and datum at the beginning of a script given a two-digit number known as a "destination" - for example, destination 45 is MGA/GDA94 Zone 56. I keep getting the following error message though:

"ERROR: Unable do determine projection for PROJ_NAME MGA_ZONE56_GDA_94_AUSTRALIAN_GEODETIC_1994."

I've been copying the related bits from a .gmw.

Anyway, here's the script - and thanks in advance!:
//PROJECTION
DEFINE_VAR NAME="DESTINATION" PROMPT="YES" PROMPT_TEXT="Please supply the project destination (eg 45)"

//AOI
DEFINE_VAR NAME="AOI" PROMPT="FILE" PROMPT_TEXT="Please select the full AOI for this project" ABORT_ON_CANCEL=YES

//PROJECT CODE
DEFINE_VAR NAME="CODE" PROMPT="YES" PROMPT_TEXT="Please give a 2-letter code for this project" ABORT_ON_CANCEL=YES

//Translate destination into something GM can understand
IF COMPARE_STR="%DESTINATION%=44"
DEFINE_VAR NAME="PROJECTION" VALUE=MGA_ZONE55_GDA_94_AUSTRALIAN_GEODETIC_1994
DEFINE_VAR NAME="PROJECTO" VALUE="MGA (Map Grid of Australia)"
DEFINE_VAR NAME="ZONED" VALUE="55"
DEFINE_VAR NAME="DATUM" VALUE="GDA94"
ELSE_IF COMPARE_STR="%DESTINATION%=45"
DEFINE_VAR NAME="PROJECTION" VALUE=MGA_ZONE56_GDA_94_AUSTRALIAN_GEODETIC_1994
DEFINE_VAR NAME="PROJECTO" VALUE="MGA (Map Grid of Australia)"
DEFINE_VAR NAME="ZONED" VALUE="56"
DEFINE_VAR NAME="DATUM" VALUE="GDA94"
ELSE_IF COMPARE_STR="%DESTINATION%=43"
DEFINE_VAR NAME="PROJECTION" VALUE=MGA_ZONE54_GDA_94_AUSTRALIAN_GEODETIC_1994
DEFINE_VAR NAME="PROJECTO" VALUE="MGA (Map Grid of Australia)"
DEFINE_VAR NAME="ZONED" VALUE="54"
DEFINE_VAR NAME="DATUM" VALUE="GDA94"
ELSE_IF COMPARE_STR="%DESTINATION%=33"
DEFINE_VAR NAME="PROJECTION" VALUE=AMG_ZONE54_AUSTRALIAN_GEODETIC_1984
DEFINE_VAR NAME="PROJECTO" VALUE="AMG (Australian Map Grid)"
DEFINE_VAR NAME="ZONED" VALUE="54"
DEFINE_VAR NAME="DATUM" VALUE="D_AUSTRALIAN_1984"
ELSE_IF COMPARE_STR="%DESTINATION%=34"
DEFINE_VAR NAME="PROJECTION" VALUE=AMG_ZONE55_AUSTRALIAN_GEODETIC_1984
DEFINE_VAR NAME="PROJECTO" VALUE="AMG (Australian Map Grid)"
DEFINE_VAR NAME="ZONED" VALUE="55"
DEFINE_VAR NAME="DATUM" VALUE="D_AUSTRALIAN_1984"
ELSE_IF COMPARE_STR="%DESTINATION%=35"
DEFINE_VAR NAME="PROJECTION" VALUE=AMG_ZONE56_AUSTRALIAN_GEODETIC_1984
DEFINE_VAR NAME="PROJECTO" VALUE="AMG (Australian Map Grid)"
DEFINE_VAR NAME="ZONED" VALUE="56"
DEFINE_VAR NAME="DATUM" VALUE="D_AUSTRALIAN_1984"
ELSE
DEFINE_VAR NAME="PROJECTION" VALUE=MGA_ZONE56_GDA_94_AUSTRALIAN_GEODETIC_1994
DEFINE_VAR NAME="PROJECTO" VALUE="MGA (Map Grid of Australia)"
DEFINE_VAR NAME="ZONED" VALUE="56"
DEFINE_VAR NAME="DATUM" VALUE="GDA94"
END_IF

DEFINE_PROJ PROJ_NAME=%PROJECTION%
Projection %PROJECTO%
Datum %DATUM%
Zunits NO
Units METERS
ZONED %ZONED%
Xshift 0.000000
Yshift 0.000000
Parameters

(Main script here - it's quite long, so have edited out)

 
END_DEFINE_PROJ

Best Answer

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,686
    Answer ✓
    Hello,

    It may be a typo in your post, but it appears that you have your entire script inside the DEFINE_PROJ/END_DEFINE_PROJ statements.  Can you put your script in a zip file and post it?

    Cheers,
    Bob

Answers

  • EllieEllie Global Mapper User Posts: 24
    Wow, I can't even remember what I was doing with this script... once I find it again, I will post.
Sign In or Register to comment.