My script to export data to usgs executes however it does not result in any output


I want to export multiple .tif files or .tif files in a .tar zip to usgs dem format.

The following is the script I tried for exporting all the files in the directory. 

calling this script in command prompt does not give any, however it does give any result as well.  




GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
// Loop over all DEM files in a folder and convert them
DIR_LOOP_START DIRECTORY="J:\Data\" FILENAME_MASKS="*.tif" RECURSE_DIR=NO
// Import an archived SDTS DEM file. Global Mapper will automatically
// determine that this is an archived SDTS DEM file and load it
// correctly.
IMPORT FILENAME="%FNAME_W_DIR%" ANTI_ALIAS=YES
// Export Raster file to USGS DEM.
EXPORT_RASTER FILENAME="%DIR%%FNAME_WO_EXT%.DEM" TYPE=USGS_DEM GEN_PRJ_FILE=YES
// Unload the loaded data
UNLOAD_ALL
// End the loop
DIR_LOOP_END


Trying to find out the issue and a solution.

Thanks in advance,
Pavan.

Comments

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

    Do your GeoTIFF files load correctly in the UI for Global Mapper?  When you are going to import a file in a script, it is often helpful to load the file with the settings that you want in the main user interface and then save a workspace. A workspace file is a script, so you can examine the IMPORT command for your file in the .gmw to see what other parameters may have been set. The LOAD_FLAGS parameter can be important.  In particular, GeoTIFF files often need a parameter that indicates whether it is a raster image or elevation grid.

    Cheers,
    Bob
  • pavanvijjapupavanvijjapu Posts: 2
    Thanks Bob, using import parameters works.
Sign In or Register to comment.