Global Mapper Pro

Importing grayscale tiff for elevation

Syrett
Syrett Global Mapper UserTrusted User
edited April 2012 in Elevation Data
A couple of years ago, I got some advice on this Forum about importing a grayscale tiff and then adjusting the elevations on it. This is what I was told:

"If you can export the TIFF as a 16-bit grayscale TIFF file then you can bring it into Global Mapper as an elevation TIFF. Once you have the data as an elevation layer, you can provide a scale factor and offset to adjust the range as desired by opening the Control Center, pressing Options, then going to the Adjust Elevations tab and entering the correct information.

If you can only get an 8-bit grayscale TIFF out of Photoshop, you can bring that into Global Mapper, then immediately export that to a 8-bit grayscale BIL file, then load that BIL file back in as an elevation layer and apply the same steps as above."

As I recall, it worked at that time. But now I can't get it to work! When I import a 16 bit tiff the grayscale looks completely different -- the tones are all changed. If I bring it in as 8 bit, it looks right, but when I run it through the BIL "loop", once again the grayscale changes -- in fact, even more than the 16 bit attempt.

I've gone through this carefully several times, and always with the same results. I'm on version 10.02. Suggestions?

Charles Syrett

Comments

  • global_mapper
    global_mapper Administrator
    edited November 2010
    Charles,

    When you bring in the 16-bit TIFF are you being prompted to treat it as elevation or imagery? What you would want to select is the option to treat it as elevation data so the grayscale values are interpreted as elevations and not grayscale values that are adjusted for an 8-bit display.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Syrett
    Syrett Global Mapper User Trusted User
    edited November 2010
    Yes, that's what I did. The values are badly distorted. Several areas of high elevation have been reinterpreted as being deep depressions. FYI, the tiff was generated in Photoshop, and it looked just fine there. And as I mentioned before, the 8 bit version looks good in Global Mapper.

    Charles Syrett
  • global_mapper
    global_mapper Administrator
    edited November 2010
    Charles,

    Ah it sounds like the elevation values are being interpreted as signed rather than unsigned values. Newer versions of Global Mapper support using the data type code in the GeoTIFF to properly interpret them as signed or unsigned, although I'm not sure if Photoshop stores that. Can you try getting the latest v12 demo from the trial link at http://www.globalmapper.com and see if it loads properly in that?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Syrett
    Syrett Global Mapper User Trusted User
    edited November 2010
    I just downed version 12 and opened the tiff, and it looks exactly the same as in version 10.

    Charles Syrett
  • global_mapper
    global_mapper Administrator
    edited November 2010
    Charles,

    Then it sounds like Photoshop isn't marking the samples as unsigned so Global Mapper is assuming they are signed. What you can do in v10 is load the file twice, treating as elevations both times. For one layer go to the Adjust Elevations tab of the Options dialog and set the minimum valid elevation to 0, which will make all of the negative areas become blank. Then on the other one, go to the same Adjust Elevations tab and again make 0 the minimum valid value, but also provide a scale factor of -1 and and offset of 1 to convert the negative values to positive ones.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Syrett
    Syrett Global Mapper User Trusted User
    edited November 2010
    OK, I just tried that. In the first instance, the negative values were voided. In the second instance, the positive values were voided, but the remaining hills are still reversed. In other words, the values increase where they should decrease. Is there a way around this?

    BTW, the end result I'm looking for is contours. Assuming that we can reverse the hills again, I guess what I would then do is reset the elevations on both layers so that they're correct, and then contour with both layers open.

    Charles
  • global_mapper
    global_mapper Administrator
    edited November 2010
    Charles,

    Can you provide a sample file so I can take a look? I actually think instead of applying a scale of -1 and an offset of 1 you need to apply a scale of -1 and an offset of 32768, but I could more easily tell for sure with a sample.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • global_mapper
    global_mapper Administrator
    edited November 2010
    Charles,

    Do you have a sample that I could look at? I think you may need to apply an offset of 32768 rather than 1 when you apply the scale of -1, but if you have a sample I could easily tell.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Syrett
    Syrett Global Mapper User Trusted User
    edited November 2010
    Here's the 16-bit tiff I've been working with: http://www.mapgraphics.net/downloads/GreyDEM-Gauss3.tif
    Thanks!
    Charles
  • global_mapper
    global_mapper Administrator
    edited November 2010
    Ok thanks I've figured it out now. In addition to just limiting one layer to a minimum valid value of 0, the other layer should keep the scale value of 1, but use an offset of 65535 and set the maximum valid value to 65535, then you should get what you want.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Syrett
    Syrett Global Mapper User Trusted User
    edited November 2010
    Now it looks right! Thanks!

    Charles
  • Syrett
    Syrett Global Mapper User Trusted User
    edited April 2012
    I'm back on this project again, and now I'm trying to get the imported 8-bit BIL to change its elevations. I haven't found any source that completely explains how to use the Alter Elevation Values dialog so that a range of A feet to B feet changes to X feet to Y feet. In this particular case, the BIL file comes in with a range of 748.794 feet (in the ocean) to 212,408 feet (height of land). How do I use the dialog so that the ocean becomes 0, the height of land becomes 610 feet, and all the other values are distributed in a linear gradation? Nothing seems to be working. The BIL file is here:
    http://www.mapgraphics.net/downloads/DEM-BIL.zip

    Oh - and I'm on Global Mapper 13 now.

    Thanks!
    Charles
  • global_mapper
    global_mapper Administrator
    edited April 2012
    Charles,

    You would use a scale factor that is ( Y - X ) / ( B - A ) and working backwards from the equation on the Alter Elevations dialog the offset would be X - ( ( ( Y - X ) * A ) / ( B - A ) ).

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • Syrett
    Syrett Global Mapper User Trusted User
    edited April 2012
    Thanks, Mike – that worked! Nothing like a clean mathematical method. :-)

    Charles
Sign In or Register to comment.