Tiling images into 256x256 tiles has gaps
earthstar
Global Mapper User
I have a requirement to tile a few thousand 1x1 degree GeoTIFF images into 256x256 pixel tiles that need to be butt-joined (no overlap). I have made Global Mapper scripts to process them. In the script I window in on exact 1x1 deg AOIs using "GLOBAL_BOUNDS=" and I have turned on the Maintain Export Bounds Instead of Sample Spacing in the GUI to force export of the exact 1x1 degree areas and resample the resolution as needed. For the most part it turns out OK except that there is a 1-pixel gap or overlap between the groups of tiles for each of the original 1x1 degree areas. (The tiles inside each 1x1 degree group butt join perfectly with no gaps or overlap.) My output format is JPEG with World files. I'm wondering if this is just a rounding error in the World files? Any ideas appreciated. I can provide a test sample and script if needed. A sample line from a script is below:
UNLOAD_ALL
IMPORT FILENAME=C:\Test_1x1_tiles\N30-E074.tif
EXPORT_RASTER FILENAME=I:\15m_256_tiles\N30-E074.jpg TYPE=JPEG SPATIAL_RES=0.0001388,0.0001388 FORCE_SQUARE_PIXELS=YES GLOBAL_BOUNDS=74,30,75,31 GEN_WORLD_FILE=YES GRID_TYPE_PIXEL_SIZE=256,256 QUALITY=75
UNLOAD_ALL
IMPORT FILENAME=C:\Test_1x1_tiles\N30-E074.tif
EXPORT_RASTER FILENAME=I:\15m_256_tiles\N30-E074.jpg TYPE=JPEG SPATIAL_RES=0.0001388,0.0001388 FORCE_SQUARE_PIXELS=YES GLOBAL_BOUNDS=74,30,75,31 GEN_WORLD_FILE=YES GRID_TYPE_PIXEL_SIZE=256,256 QUALITY=75
Comments
-
Which version of Global Mapper are you using? Do you have the data loaded that goes all the way to the tile edge prior to doing the export? If you check the metadata for the images on the edge do they actually go to the edge and have a pixel of background data?
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/products/global-mapper.php -
Mike - I am using 14.1.3. My input images are actually slightly more
than 1x1 degree, so I know there is data right up to (and beyond)
the 1 degree mark. (I added 10 pixels of overlap when I made the 1x1
degree GeoTIFF tiles.) Because of this, in the script I am windowing in
on exact 1x1 degree increments for the export.global_mapper wrote: »Which version of Global Mapper are you using? Do you have the data loaded that goes all the way to the tile edge prior to doing the export? If you check the metadata for the images on the edge do they actually go to the edge and have a pixel of background data?
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/products/global-mapper.php -
Is your export projection datum the same as the input data datum? If there was a datum shift that could do it. If that's not it, do you get the same issue if you export clamped to those exact bounds from the user interface? I'm just wondering if this is a script-specific issue.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/products/global-mapper.php -
Mike - There is no projection change. You are right though about the GUI
vs script - I do not get this issue if I manually run each file through the
GUI with the same parameters. The World files generated by GUI vs script
are slightly different. I can send you test data, etc. if you need it. Or if there
is a way to do 1000's of files through the GUI let me know.global_mapper wrote: »Is your export projection datum the same as the input data datum? If there was a datum shift that could do it. If that's not it, do you get the same issue if you export clamped to those exact bounds from the user interface? I'm just wondering if this is a script-specific issue.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/products/global-mapper.php -
Yes can you send me a test file and your script so I can try it? There is likely just something with the maintain export bounds over sample spacing setting or something like that.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/products/global-mapper.php -
Ah I see. What you need to do is add GRID_KEEP_CELL_SIZE=YES to your EXPORT_RASTER script command as that specifies whether the bounds should be maintained over the sample spacing for scripting rather than the setting in the user interface.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/products/global-mapper.php -
Mike - Adding GRID_KEEP_CELL_SIZE=YES worked perfectly. Thanks for your usual outstanding tech support!
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website