Global Mapper Pro Coming Soon

exporting single band files from multiband input

johncrjohncr Global Mapper UserPosts: 2
edited June 2010 in Technical Support
I have a signed 16-bit integer BSQ with 186 bands and want to create 186 single band files. Is there any way of batch importing the BSQ and exporting single band files using scripting language? Is there some way of looping a script to increment the file name and band assignment to do this?

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2010
    What you could do is create a series of files named 1, 2, 3, ..., 186 in some folder, then use the DIR_LOOP_START and DIR_LOOP_END command to loop over all of those files. You would then be able to use the variable %FNAME_WO_EXT% within the commands within that loop to specify the band to export and make that part of the new filename. You would import the BSQ file prior to the loop.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • johncrjohncr Global Mapper User Posts: 2
    edited June 2010
    Hi Mike,
    Thanks for the reply. Saving as individual files seems a bit complex. However a more simple request is to convert the 186 band 16-bit BSQ to BIL format, and retain the 16-bit depth. In the script reference there isn't an option for importing BSQ, (prompt appears for input type) and the export raster is always 3 band 8-bit, rather than defaulting to the input bit depth and bands. Is there some way of doing this conversion through scripting?
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2010
    There is not currently a way to export imagery BIL/BSQ files with anything other than 8 bits per color channel, although we are hoping to add support for higher bit depths for BIL exports in the v12 release.

    Right now you could export to a 16-bit per channel GeoTIFF file if you can use that.

    Also note that for BSQ import in a script, just use the type for a BIL file, they are the same in the script.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.