New problem with old script

Amanda McDermottAmanda McDermott Global Mapper UserPosts: 56Trusted User
When running a trusty 'export geotiff' script that I have never had a problem with, I am getting an error message "WARNING: Unknown parameter <EXPORT_RASTER> ignored."

I suspect there must be a bug, it worked fine until recently and I think the error has occurred since I updated to GM 17.1.2.

Hope you can help please.

Comments

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,698
    Hello Amanda,

    EXPORT_RASTER is a command, not a parameter, so it sounds like the line before the EXPORT_RASTER might end in "\<newline>", which makes GM think that the command continues on the next line.  

    If that doesn't help, attach the script file and I will take a look.

    Cheers,

    Bob
  • Amanda McDermottAmanda McDermott Global Mapper User Posts: 56Trusted User
    Thanks Bob, it doesn't contain <newline>, but does use \ (which I think it needs?) File attached...
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,698
    Thanks Bob, it doesn't contain <newline>, but does use \ (which I think it needs?) File attached...
    In the following command, you need to remove the final "\".  
    DEFINE_VAR \
    NAME=FILENAME \
    PROMPT="DIR"\
    PROMPT_TEXT=Filepath_eg_"C:\Users\2B-Vostro\Desktop\export" \
    That is causing GM to process the next line (EXPORT_RASTER) as a continuation of the current command, when, in fact, it is a new command.  You should also put the entire string specified for PROMPT_TEXT in quotes.  It should look like this:
    DEFINE_VAR \
    NAME=FILENAME \
    PROMPT="DIR"\
    PROMPT_TEXT="Filepath, e.g., C:\Users\2B-Vostro\Desktop\export"
    Cheers,

    Bob
  • Amanda McDermottAmanda McDermott Global Mapper User Posts: 56Trusted User
    Hi Bob,

    Thank you very much, works like a dream :)

    Incidentally, I don't seem to get notified of new Forum posts via email nowadays, any idea how to set that up please?

    Amanda
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,698
    Hi Amanda,
    Incidentally, I don't seem to get notified of new Forum posts via email nowadays, any idea how to set that up please?

    Amanda
    1. At the top of the screen, to the right of your user-name, click the gear and choose Edit Profile.
    2. On the left side of the screen, choose Notification Preferences
    3. Choose the option to be notified by e-mail when someone comments on discussions that you have participated in
    Cheers,

    Bob
  • Amanda McDermottAmanda McDermott Global Mapper User Posts: 56Trusted User
    Thank you!
  • Amanda McDermottAmanda McDermott Global Mapper User Posts: 56Trusted User
    Hello again,

    I have now realised that there is still a problem with this script. I thought it was working because it exported a .TIF file.

    However, although it now exports a .TIF, the file is not to the specified scale, which I really need it to be.

    Thoughts appreciated, please.

    The script again:

    GLOBAL_MAPPER_SCRIPT VERSION=1.00


    DEFINE_VAR \
    NAME=ChosenPathAndName \
    PROMPT=FILE \
    PROMPT_TEXT="Choose filepath and name, e.g. C:\Users\2B-Vostro\Desktop\export\25k"


    EXPORT_RASTER \
    FILENAME="%ChosenPathAndName%.TIF" \
    TYPE=GEOTIFF \
    COMPRESSION=LZW \
    INC_VECTOR_DATA=YES \
    SAVE_SCALE_AND_LEGEND=YES \
    EXPORT_SCALE=25000 \
    DPI=300 \
    LAYER_BOUNDS="crop boundary 25k"


  • Amanda McDermottAmanda McDermott Global Mapper User Posts: 56Trusted User
    Help please!

    I have come to use this script for the first time with GM 18(.2) and it is having problems again - error message "ERROR: Data must be loaded for EXPORT_RASTER command." (The bug where it was exporting to incorrect scale had been resolved).



  • bmg_bobbmg_bob Global Mapper Programmer Posts: 1,698
    Hello,

    Are you using the same script that is posted above?  That script does not contain an IMPORT command, so it is not loading any data.  If you are running the script via the File | Run Script... command with some data already loaded, be sure to put a check next to "Run Script in the Context of the main View".

    Cheers,
    Bob
  • Amanda McDermottAmanda McDermott Global Mapper User Posts: 56Trusted User
    Hello Bob,

    As ever, thank you for prompt and correct advice - the check box did the trick! I had forgotten that it needs checking again when I first run a script on a new installation (it saves the preference after that).
Sign In or Register to comment.