New problem with old script

Amanda McDermott
Global Mapper UserTrusted User
in Bug Report
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.
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
-
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 -
Thanks Bob, it doesn't contain <newline>, but does use \ (which I think it needs?) File attached...
-
Amanda McDermott said:Thanks Bob, it doesn't contain <newline>, but does use \ (which I think it needs?) File attached...
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 \
Cheers,
NAME=FILENAME \
PROMPT="DIR"\
PROMPT_TEXT="Filepath, e.g., C:\Users\2B-Vostro\Desktop\export"
Bob -
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
-
Hi Amanda,Amanda McDermott said:Incidentally, I don't seem to get notified of new Forum posts via email nowadays, any idea how to set that up please?
Amanda- At the top of the screen, to the right of your user-name, click the gear and choose Edit Profile.
- On the left side of the screen, choose Notification Preferences
- Choose the option to be notified by e-mail when someone comments on discussions that you have participated in
Bob -
Thank you!
-
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"
-
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).
-
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 -
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).
Categories
- 12.9K All Categories
- 5.7K Features Discussion
- 346 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 643 GM Script Language
- 54 User Scripts
- 115 GPS Features
- 419 Projection Questions
- 829 Raster Data
- 1.4K Vector Data
- 6.6K Support
- 179 Announcement and News
- 926 Bug Report
- 561 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 574 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 241 How I use Global Mapper
- 108 Global Mapper Forum Website