Script producing different results in GM 13.1.x and 13.2.0

tjhbtjhb Global Mapper UserPosts: 454Trusted User
edited June 2012 in Bug Report
Mike,

I have a script I've used (with variations as you've added new features) in several versions of Global Mapper to rasterize vector data to GeoTIFF, splitting output by tile (using POLYGON_CROP_FILE, POLYGON_CROP_USE_EACH, POLYGON_CROP_NAME_ATTR and POLYGON_CROP_FOLDER_ATTR).

It has worked consistently up until version 13.1.3, but stopped working as expected (by me) with 13.2.0.

Under version 13.1.3 (installer dated 29 March 2012) the log file reads like this, and I get output for each of the 17 tiles in my grid of areas (%AOI%).
Removed all loaded overlays.
Loading new global projection...
Loading style file...
Starting loop over all files in directory...
Importing file D:\{Input}\Lines 4px\wharf_edge.shp...
Exporting raster data to file D:\{Output}\wharf_edge_.tif...
Loop over files in directory completed.
Removed all loaded overlays.
Script processing COMPLETED.

With the same test data, under 13.2.0 (installer dated 17 May 2012) the log shows this, and I get no output.
Removed all loaded overlays.
Loading new global projection...
Loading style file...
Starting loop over all files in directory...
Importing file D:\{Input}\Lines 4px\wharf_edge.shp...
Exporting raster data to file D:\{Output}\wharf_edge_.tif...
ERROR: Export bounds empty for EXPORT_RASTER command.
ERROR: No raster data found for EXPORT_RASTER command.
Loop over files in directory completed.
Removed all loaded overlays.
Script processing COMPLETED.

The script is below (and attached). Am I missing something obvious?

(I can supply test data if you like.)
GLOBAL_MAPPER_SCRIPT VERSION=1.00

// Rasterize line shapefiles, splitting by AOI tile
// * Updated for GM 13.x *

DEFINE_VAR NAME="AOI" \
VALUE="D:\{Input}\AOI\Grid 65536m (overlapped) land.shp"
//VALUE="D:\{Input}\AOI\Grid 65536m (overlapped) north.shp"
//VALUE="D:\{Input}\AOI\Grid 65536m (overlapped) south.shp"
DEFINE_VAR NAME="OVERWRITE" \
//VALUE="YES" // Default
VALUE="NO"

SET_LOG_FILE \
FILENAME="D:\{Output}\GM lines.txt"

UNLOAD_ALL

// Define source projection
DEFINE_PROJ \
PROJ_NAME="NZTM2000_NZGD2000"
Projection New Zealand Transverse Mercator 2000
Datum NZGD_2000
Zunits NO
Units METERS
Xshift 0.000000
Yshift 0.000000
Parameters
END_DEFINE_PROJ

// Set target projection
LOAD_PROJECTION \
// PROJ_NAME="NZTM2000_NZGD2000" // * Deprecated *
PROJ="NZTM2000_NZGD2000"

// Set background to black
SET_BG_COLOR \
COLOR=RGB(0,0,0)

// Load custom style(s)
LOAD_STYLE_FILE \
FILENAME="D:\{Input}\Line styles.gm_style" \
ADD_UNKNOWN_TYPES=YES

DIR_LOOP_START \
DIRECTORY="D:\{Input}\Lines 4px" \
FILENAME_MASKS="*.SHP" \
RECURSE_DIR=NO

// Import source file and assign source projection
// and style
IMPORT \
FILENAME="%FNAME_W_DIR%" \
TYPE=SHAPEFILE \
// PROJ_NAME="NZTM2000_NZGD2000" \ // * Deprecated *
PROJ="NZTM2000_NZGD2000" \
LINE_TYPE="White 4px solid"

// Rasterize to GeoTIFF, splitting by AOI tile
// with output in named subfolders
EXPORT_RASTER \
FILENAME="D:\{Output}\%FNAME_WO_EXT%_.tif" \
TYPE=GEOTIFF \
// Omit PALETTE option for 24-bit RGB (the default)
PALETTE=BLACKISMIN \
// Specify pixel resolution
// 4.0 mpx
// (18432px per 65536m tile)
SPATIAL_RES=4.0,4.0 \
// Specify target pixel dimensions instead
// PIXEL_SIZE=18432x18432 \
FORCE_SQUARE_PIXELS=YES \
INC_VECTOR_DATA=YES \
// Specify tiling grid
POLYGON_CROP_FILE="%AOI%" \
// Needs a PRJ file
POLYGON_CROP_BBOX_ONLY=NO \
POLYGON_CROP_USE_EACH=YES \
POLYGON_CROP_NAME_ATTR="Name" \
POLYGON_CROP_FOLDER_ATTR="Name" \
// Currently, to use POLYGON_CROP_FOLDER_ATTR
// POLYGON_CROP_NAME_ATTR must also be specified
BG_TRANSPARENT=NO \
DPI=300 \
// TILE_SIZE=256 \
// USE_LZW=YES \ // * Deprecated *
COMPRESSION=LZW \
DISABLE_BIGTIFF=NO \
GEN_WORLD_FILE=YES \
GEN_PRJ_FILE=NO \
OVERWRITE_EXISTING=%OVERWRITE%

// Close source file
UNLOAD_LAYER \
FILENAME="%FNAME%"

DIR_LOOP_END

UNLOAD_ALL

// Reset background to white
SET_BG_COLOR \
COLOR=RGB(255,255,255)

Rasterize shapefiles to tiles (lines, 4px solid).gms

Comments

Sign In or Register to comment.