EXPORT_WEB command error

winkyautumnwinkyautumn Posts: 9
edited July 2015 in GM Script Language
Hello, I'm trying to export my geotiffs to OSM by using script. Here it is.

GLOBAL_MAPPER_SCRIPT VERSION=1.00
DIR_LOOP_START DIRECTORY="D:\change_h95\Site2" FILENAME_MASKS="1_400.tif" RECURSE_DIR="yes"
IMPORT FILENAME="%FNAME_W_DIR%"
EXPORT_WEB FILENAME="1" TYPE="OSM" MAX_ZOOM_LEVEL="9" NUM_ZOOM_LEVELS="3"
UNLOAD_ALL
DIR_LOOP_END

So, as you can see, I've got the directory "Site2" with subdirectories and I need to export all the files with the name "1_400.tif". However, when i run this script, I get an error for every tile.

"Version: v16.0.5 (64-bit)
Build Time: Nov 18 2014 14:10:19
Use Ctrl+V to Paste Error
WARNING: Unable to generate PNG file.
Unable to create file 7\109\37.png
PNGOverlay.cpp - 639"


How can I deal with it? Thank you.

Best Answer

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,235
    Answer ✓
    The FILENAME parameter should contain the full path and file name for the output HTML file that will be used to display your tiles. The path from that file is used to create the output path for the individual tiles. I suspect that FILENAME="1" is causing the problem. Something similar FILENAME="C:\Output\%FNAME_WO_EXT%.htm" ought to work better.

Answers

  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,235
    Hello,

    As a first step, I recommend getting the latest update for Global Mapper 16 to see if this problem has been addressed.

    Cheers,

    Bob
  • winkyautumnwinkyautumn Posts: 9
    edited July 2015
    I have updated to 16.2 and still I'm getting an error for each tile, but now it's a slightly different one.

    Importing file ...
    Exporting data to 1...
    WARNING: Unable to generate RGB PNG file 7\108\37.png
    Unable to create file 7\108\37.png
    PNGOverlay.cpp - 622

    And I forgot to mention that if I'm doing the export manually, everything works and tiles are being created.
  • Thank you, that really solved my problem. I've got another little question (it's not critical) - I noticed that export done by script is much slower than export done manually. Is it supposed to be so?
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,235
    Assuming that the scripted export and the manual export are the same, then there should be little to no difference in how long it takes. Your script is importing each file before exporting it. Doing the export manually, you presumably had already imported the file, so the elapsed time for only the export does not include the import time.
  • You are right, each file is being imported, but i was speaking about only the "export" phase. It's much slower when triggered by script. Export of each TIF (judging by the progress bar window) lasts approximately 10-20 times slower.
Sign In or Register to comment.