LAYER_BOUNDS="%state_background%" USE_EXACT_BOUNDS=YES not working in script

MorganRS
MorganRS Global Mapper UserTrusted User
edited April 2016 in Bug Report
I use Global Mapper 17 to tile datasets out for use later on in an ArcGIS python script. Recently I started to notice that defining the layer bounds of another layer to use as the export bounds doesn't seem to be working correctly in script. Here is how this shp file should look when all is finished

When I comment the Global Mapper Export Script out of the script and do the export manually, setting the export bounds manually, the end result is as desired.
If I leave the Global Mapper export portion of the script in, and run it, this is the result.

The export bounds of the tiles isn't matching up correctly.
I'm using GM17.1 (b040816) 64bit
Here is the Global Mapper Script part of my script:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
DEFINE_PROJ PROJ_NAME="GEO_WGS84"
Projection GEOGRAPHIC
Datum WGS84
Zunits NO
Units DD
Xshift 0.000000
Yshift 0.000000
Parameters
0 0 0.000 /* longitude of center of projection
END_DEFINE_PROJ
DEFINE_VAR NAME="state" VALUE="MT"
DEFINE_VAR NAME="user" VALUE="Morgan"
SET_LOG_FILE FILENAME="G:\Users\%user%\DATA_STATE\%state%\%state%_pub_grid_erase.log"
LOG_MESSAGE %state% variable defined
DEFINE_VAR NAME="year" VALUE="2016"
DEFINE_VAR NAME="public_lands" VALUE="G:\Data_State\%state%\Public_Lands\%year%_complete\MT_PubLands_04152016.shp"
DEFINE_VAR NAME="export_extents" VALUE="G:\Data_State\%state%\Administrative_Boundaries\2013_complete\%state%_State_Area.shp"
LOG_MESSAGE %export_extents% variable defined
LOG_MESSAGE %year% variable defined
DEFINE_VAR NAME="rows" VALUE="4"
DEFINE_VAR NAME="columns" VALUE="8"
DEFINE_VAR NAME="in_Directory1" VALUE="G:\Data_State\MT\Parcels\2016_process\First_Check_Parcels"
DEFINE_VAR NAME="in_Directory2" VALUE="G:\Data_State\MT\Parcels\2016_process\Additonal_Layers"
DEFINE_VAR NAME="run3_final_checks" VALUE="G:\Data_State\%state%\Parcels\%year%_process\Run3\Final_Parcels"
DEFINE_VAR NAME="run4_final_checks" VALUE="G:\Data_State\%state%\Parcels\%year%_process\Run4\Final_Parcels"
DEFINE_VAR NAME="%state%_FINAL_ERASE" VALUE="C:\Workspace\%user%\%state%\ERASE\PUB_ERASE\Multipart_Proj\*.shp"
DEFINE_VAR NAME="county_areas" VALUE="G:\Data_State\%state%\Administrative_Boundaries\2013_complete\%state%_County_Areas.shp"
DEFINE_VAR NAME="county_areas_export" VALUE="C:\Workspace\%user%\%state%\%state%_County_Areas.shp"
DEFINE_VAR NAME="pub_export" VALUE="C:\Workspace\%user%\%state%\ERASE\PUB_ERASE\%state%_ERASE_INPUTS\er_%state%.shp"
DEFINE_VAR NAME="county_export" VALUE="C:\Workspace\%user%\%state%\ERASE\PUB_ERASE\%state%_ERASE_INPUTS\%state%.shp"
LOG_MESSAGE -------------------------------------------------------------------------------------------------------------------------------- Importing %state% County AREAS shp file
IMPORT FILENAME="%county_areas%" TYPE=SHAPEFILE SHAPE_TYPE=AREAS PROJ_NAME="GEO_WGS84"
LOG_MESSAGE -------------------------------------------------------------------------------------------------------------------------------- Editing county AREAS file
EDIT_VECTOR ATTR_REPLACE_STR="NAME=County: ="
EDIT_VECTOR ATTR_REPLACE_STR="NAME= ="
EDIT_VECTOR ATTR_REPLACE_STR="NAME=St.=St_"
CALC_ATTR_FORMULA NEW_ATTR="NAME" FORMULA="NAME + '_PubErase'"
EXPORT_VECTOR FILENAME="%county_areas_export%" TYPE=SHAPEFILE SHAPE_TYPE=AREAS GEN_PRJ_FILE=YES
UNLOAD_ALL
LOG_MESSAGE -------------------------------------------------------------------------------------------------------------------------------- 'Importing %state% state area shp file.'
IMPORT FILENAME="%export_extents%" TYPE=SHAPEFILE PROJ_NAME="GEO_WGS84"
SET_LAYER_OPTIONS FILENAME="%export_extents%" HIDDEN=YES
LOG_MESSAGE -------------------------------------------------------------------------------------------------------------------------------- %state_background% turned off
LOG_MESSAGE -------------------------------------------------------------------------------------------------------------------------------- Importing %state% Public Lands file-------------------------
IMPORT FILENAME="%public_lands%" TYPE=SHAPEFILE PROJ_NAME="GEO_WGS84"
//EDIT_VECTOR ATTR_TO_COPY="ONX_TYPE=GRMN_TYPE"
LOG_MESSAGE -------------------------------------------------------------------------------------------------------------------------------- Removing Corps of Engineers lands----------------------------
EDIT_VECTOR DELETE_FEATURES=YES COMPARE_STR="ONX_TYPE=CORPS"
LOG_MESSAGE -------------------------------------------------------------------------------------------------------------------------------- Removing Local Parks and Forests lands----------------------
EDIT_VECTOR DELETE_FEATURES=YES COMPARE_STR="ONX_TYPE=LOCAL_P*"
LOG_MESSAGE -------------------------------------------------------------------------------------------------------------------------------- Removing NPS lands-------------------------------------------
EDIT_VECTOR DELETE_FEATURES=YES COMPARE_STR="ONX_TYPE=NPS"
LOG_MESSAGE -------------------------------------------------------------------------------------------------------------------------------- Removing BIA lands ----------------------------------------
EDIT_VECTOR DELETE_FEATURES=YES COMPARE_STR="ONX_TYPE=BIA"
EXPORT_VECTOR FILENAME="%pub_export%" TYPE=SHAPEFILE SHAPE_TYPE=AREAS GEN_PRJ_FILE=YES LAYER_BOUNDS="%export_extents%" USE_EXACT_BOUNDS=YES GRID_KEEP_CELL_SIZE=YES GRID_TYPE_ROWS_COLS="%rows%,%columns%" GRID_NAMING=SEPARATE GRID_NAMING_COLS="NUM,1," GRID_NAMING_ROWS="ALPHA,A," PROJ_NAME="GEO_WGS84"
SET_LAYER_OPTIONS FILENAME="%public_lands%" HIDDEN=YES
LOG_MESSAGE -------------------------------------------------------------------------------------------------------------------------------- %public_lands% turned off--------------------------------------
//IMPORT_DIR_TREE DIRECTORY="G:\Data_State\%state%\Parcels\%year%_complete\Complete_Areas" FILENAME_MASKS="*.SHP" RECURSE_DIR=NO
IMPORT_DIR_TREE DIRECTORY="%in_Directory1%" FILENAME_MASKS="*.SHP" RECURSE_DIR=NO
IMPORT_DIR_TREE DIRECTORY="%in_Directory2%" FILENAME_MASKS="*_ERS.SHP" RECURSE_DIR=NO
//IMPORT_DIR_TREE DIRECTORY="%run3_final_checks%" FILENAME_MASKS="*.SHP" RECURSE_DIR=NO
//IMPORT_DIR_TREE DIRECTORY="%run4_final_checks%" FILENAME_MASKS="*.SHP" RECURSE_DIR=NO
EXPORT_VECTOR FILENAME="C:\Workspace\%user%\%state%\ERASE\PUB_ERASE\%state%_ERASE_INPUTS\%state%.shp" TYPE=SHAPEFILE SHAPE_TYPE=AREAS GEN_PRJ_FILE=YES LAYER_BOUNDS="%state_background%" USE_EXACT_BOUNDS=YES GRID_KEEP_CELL_SIZE=YES GRID_TYPE_ROWS_COLS="%rows%,%columns%" GRID_NAMING=SEPARATE GRID_NAMING_COLS="NUM,1," GRID_NAMING_ROWS="ALPHA,A," PROJ_NAME="GEO_WGS84"
UNLOAD_ALL


I tried running the script without defining the projection and still got the same results.

Answers

  • bmg_bob
    bmg_bob Global Mapper Programmer
    Answer ✓
    Hello,

    I don't see a DEFINE_VAR for %state_background%.  Where is the value for that variable coming from?

    Cheers,

    Bob
  • MorganRS
    MorganRS Global Mapper User Trusted User
    DOH! Sometimes I guess you need a fresh set of eyes, because I completely missed that. Thanks. Fixed it and ran it and it's working fine.