Odd Raster Export Results in a Script
gomckenz
Global Mapper User
I have a series of XYZ files that I want to import as ascii and export as PNG. The script seems to work fine except for one small detail.
The exported PNG files show my data split into sections. For example, the very first file processed is a long narrow strip of data. It has data on the west side and the east side of the image with a big gap in the middle. It looks like the image is wrapped around the edges. Other images that should be square are broken into smaller pieces with these same kind of gaps.
I can process each file individually and everything is just fine. I'm wondering what I might have wrong. I've tried the export with and without the spatial_res.
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD ALL
IMPORT_ASCII FILENAME="D:\E09.xyz" TYPE="ELEVATION" COORD_DELIM="AUTO" COORD_ORDER="X_FIRST" PROJ_EPSG_CODE="26910" SPATIAL_RES=1.0,1.0
EXPORT_RASTER FILENAME="D:\E09.PNG" TYPE="PNG" FORCE_SQUARE_PIXELS ="YES" GEN_WORLD_FILE=YES PALETTE="GRAYSCALE" BG_TRANSPARENT
IMPORT_ASCII FILENAME="D:\G09.xyz" TYPE="ELEVATION" COORD_DELIM="AUTO" COORD_ORDER="X_FIRST" PROJ_EPSG_CODE="26910" SPATIAL_RES=1.0,1.0
EXPORT_RASTER FILENAME="D:\G09.PNG" TYPE="PNG" FORCE_SQUARE_PIXELS ="YES" GEN_WORLD_FILE=YES PALETTE="GRAYSCALE" BG_TRANSPARENT
The exported PNG files show my data split into sections. For example, the very first file processed is a long narrow strip of data. It has data on the west side and the east side of the image with a big gap in the middle. It looks like the image is wrapped around the edges. Other images that should be square are broken into smaller pieces with these same kind of gaps.
I can process each file individually and everything is just fine. I'm wondering what I might have wrong. I've tried the export with and without the spatial_res.
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD ALL
IMPORT_ASCII FILENAME="D:\E09.xyz" TYPE="ELEVATION" COORD_DELIM="AUTO" COORD_ORDER="X_FIRST" PROJ_EPSG_CODE="26910" SPATIAL_RES=1.0,1.0
EXPORT_RASTER FILENAME="D:\E09.PNG" TYPE="PNG" FORCE_SQUARE_PIXELS ="YES" GEN_WORLD_FILE=YES PALETTE="GRAYSCALE" BG_TRANSPARENT
IMPORT_ASCII FILENAME="D:\G09.xyz" TYPE="ELEVATION" COORD_DELIM="AUTO" COORD_ORDER="X_FIRST" PROJ_EPSG_CODE="26910" SPATIAL_RES=1.0,1.0
EXPORT_RASTER FILENAME="D:\G09.PNG" TYPE="PNG" FORCE_SQUARE_PIXELS ="YES" GEN_WORLD_FILE=YES PALETTE="GRAYSCALE" BG_TRANSPARENT
Comments
-
You need to add an UNLOAD_ALL command after your EXPORT_RASTER commands. As you have it now you are accumulating XYZ files as you keep importing them without unloading them when you are done exporting them.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Took a second look and as it turned out I had used unload_all but had typed it wrong, omitting the _ for file one and two. Bad search and replace in the text editor.
Thanks for the help
Categories
- 13K All Categories
- 5.8K Features Discussion
- 350 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 652 GM Script Language
- 56 User Scripts
- 115 GPS Features
- 421 Projection Questions
- 835 Raster Data
- 1.4K Vector Data
- 6.7K Support
- 181 Announcement and News
- 939 Bug Report
- 562 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 579 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 244 How I use Global Mapper
- 110 Global Mapper Forum Website
