Script Import/Export one Geotif at a time

scotchtscotcht Global Mapper UserPosts: 20Trusted User
edited June 2013 in Raster Data
I have hundreds of geotiff files that are seperated in folders by photo capture date. When loading one folder of tifs, they look right, but when adding another folder of tifs, the color and contrast change for all loaded tifs. i assume there's info embedded in the acquired data that fight eachother when loading together.
Basically, I need to be able to load all the data together, and do it accurately. To remedy, I've started loading all data from one folder, exporting it again as a Geotiff with desired settings. I've tested it, and the data loads together without effecting eachother. I have some 100+ folders, so this method will take forever. I've written scripts before, but it's been a long time.
I need to either figure out the color issue or write a script that will load each tif from every folder individually, re-export it, then close it. Any help getting started will be appreciated!



  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2013

    The contrast settings will default to sharing the contrast settings with all loaded data layers. If you go to the color/contrast settings tab of the Options dialog for loaded layers you can turn that off so that each image will be separately contrast adjusted (or you can turn off adjustment altogether if you want).

    If you need to share contrast adjustment between separate groups of images, you could do this in a script by using DIR_LOOP_START and DIR_LOOP_END to loop over the images in a folder, use IMPORT to load each one with CONTRAST_MODE=PERCENTAGE and CONTRAST_SHARED=YES in the parameters, then after the loop finishes use EXPORT_RASTER to export that to a new image and UNLOAD_ALL to unload everything.

    See Global Mapper Scripting Reference for details on scripting. If you have separate groups of folders to process I would actually have a DIR_LOOP_START...DIR_LOOP_END to wrap everything and use FILENAME_MASKS=".." for that one so you hit each folder once, then have a nested loop in that for each folder to do everything in the previous paragraph.

    Let me know if I can be of further assistance.


    Global Mapper Guru
Sign In or Register to comment.