Multi-page GeoTIFF Files in GM10?

iochromaiochroma Global Mapper UserPosts: 4
edited April 2010 in Technical Support
Hi Mike,

I have a number of GeoTIFF Files containing signed 16 bit elevation data which load fine in GM10 after answering the dialogue query "raster or elevation?" Since Win7 only shows these files as black, either as thumbnails or in Photo Editor, I decided to add a second page to the files containing a simple 8 bit paletted RGB image and make this the first page in the files. I have also added some new private tags to both pages which should be ignored by any reader. As a result I can now conveniently view them as thumbnails when browsing the directory whilst still retaining the elevation information needed for my software to construct path profiles.

My query relates to how GM10 is handling these files since I observe some seemingly random and unpredictable behaviour when loading them into GM10. My early thoughts were that GM only read the first page but then why am I still presented with the dialogue box at load?. The status bar shows the palette indices and the meta data supports the assumption that I am loading the RGB page 1. However, if I start changing the shader or zooming in, the image turns black at some point, as if trying to interpret the elevation data on page 2 as RGB data values. Once this happens, I can no longer view the files in GM with any shader/zoom level. As Windows Photo Editor shows both pages in the file, I believe the files have been written correctly.

Can you explain how GM10 handles multi-page GeoTIFF please Mike? Is it possible for GM to load both pages as separate lines in the Control Centre? This would keep the two images separated and allow me to view the elevation data in the status bar in GM and see thumbnails in the Windows directories. Or is the only workaround to keep two separate files?

Any explanation/thoughts would be gratefully received. I can send you a dump of the IFD tags in each page and /or a file if it would help.

Thanks,
Malcolm

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2010
    Malcolm,

    In general Global Mapper does not support multi-page TIFF files, at least not entirely (normally mapping GeoTIFF files are just a single page). It sounds like perhaps one of the pages is being interpreted as an overview layer for the data, so it is being used when you are zoomed out on the data. If you can provide a sample TIFF file with your layout I can see if it is easily possible to support in Global Mapper.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • iochromaiochroma Global Mapper User Posts: 4
    edited April 2010
    Hi Mike,

    Thanks for offering to view my file format. I have e-mailed a sample file to
    support@globalmapper.com for you.

    I have many hundred of these 1x1 degree files and it is much easier to quickly locate the right one in a directory if a viewable thumbnail is visible.

    Thanks,
    Malcolm
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2010
    Malcolm,

    I have updated Global Mapper so that if there are multiple pages that don't appear to be overview layers, then each page will be separately loaded and available. I have placed a new build at http://www.globalmapper.com/global_mapper11.zip with the change for you to try. Simply download that file and extract the contents into your existing v11.xx installation folder to give it a try. If you are using the 64-bit v11 version there is a new build at http://www.globalmapper.com/global_mapper11_64bit.zip .

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • iochromaiochroma Global Mapper User Posts: 4
    edited April 2010
    Hi Mike,

    I have installed the GM11 trial version and tried out the changes you made in the extra zip file. The Overlay Control Centre now shows both the images labelled correctly as you suggest (page 2 is first in the list) but there is still a problem with the file loading. The raster/elevation dialogue box asks the question twice for the elevation image [Page 2] but not at all for the RGB image in Page 1. As a consequence, clicking on the Options button in the OCC for the RGB image indicates that no colour palette has been loaded from the file (Pal Idx 0 - RGB(0,0,0). Hence the RGB image in Page 1 presents as totally black whereas the elevation data displays correctly. Both the elevation and palette value for each pixel is shown correctly in the status bar, however, so both the images appear to have loaded into memory OK.

    Almost there but any further thoughts?

    Regards,
    Malcolm
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2010
    Malcolm,

    I took a closer look and found the issue with the palette was that a TIFF palette has 16-bit values which are typically shifted right by 8 bits (i.e. divided by 256) for each color channel to create each RGB color entry, but all of the palette values in this file were below 256, so they all got shifted to 0 (black). I have updated Global Mapper to detect palettes that are (almost always) incorrectly encoded like this and just not shift those values so that now the colors display as intended. I have placed a new build at http://www.globalmapper.com/global_mapper11.zip with the change for you to try. Simply download that file and extract the contents into your existing v11.xx installation folder to give it a try. If you are using the 64-bit v11 version there is a new build at http://www.globalmapper.com/global_mapper11_64bit.zip .

    The double question about the elevation layer is harder to fix as it is part of the overview vs. multi-page detection (not a simple way to differentiate) and subsequent load. This may be something you will have to live with, or else you can place the vertical GeoTIFF tags in the file so that GM can recognize it as an elevation layer automatically without having to ask the user.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • iochromaiochroma Global Mapper User Posts: 4
    edited April 2010
    Hi Mike,

    Works great now!
    I am still feeling my way with the TIFF and GeoTIFF file formats and wasn't aware that leaving 8 bit palette entries in the lowest 8 bits of the individual colour channel uint16 variables was not best practice. I will change my code to write the palettes correctly as you have explained but your changes will trap anything that falls through the gap!

    The double query at load is not a real problem but I will have a go at modifying the GeoTIFF Key tags to add some vertical information. Is it sufficient to just add a '1.0' for the z entry in the ModelPixelScale tag and provide a VerticalCSTypeGeoKey and VerticalUnitsGeoKey for GM to recognize a DEM file? Or is the VerticalCitationGeoKey also required? To date, I have just been copying the Geo Tags from the source files across unchanged into my new files but I can rework them without too much effort.

    Thanks again for the swift response ~ you have just given me a reason to upgrade from GM10 to 11 !

    Cheers,
    Malcolm
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2010
    Malcolm,

    In Global Mapper just the existence of either the VerticalCSTypeGeoKey or VerticalUnitsGeoKey is enough to tell Global Mapper that the file is an elevation GeoTIFF without having to prompt the user.

    Let me know if I can be of further assistance.

    Thanks,

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