Results 1 to 10 of 18

Thread: [Award Winner] Managing SRTM information with GDAL

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Guild Novice vehrka's Avatar
    Join Date
    Mar 2009
    Location
    Valencia, Spain
    Posts
    19

    Post

    5.- Scaling.

    If you use Photoshop this is the end of the mini-tutorial, you can get the final image and start working with it.

    But I use GIMP and we won't get 16bit image support until version 2.8 (if they don't change the milestone again) so I have to scale the images to 8 bits.

    We'll use gdal_translate command for rescaling, but we're also using gdalinfo for getting some info first. With gdalinfo we can get information about the maximum and minimum of the histogram, we will use this information for rescaling to 0~255 greyscale with gdal_translate. For getting the info we type

    Code:
    gdalinfo -hist mosaico_rer.tif
    we are looking for a line wich is similar to " 256 buckets from -32835.4 to 1757". -32835.4 is a way to say NULL or no data, and 1757 is the maximum.

    Code:
    gdal_translate -ot Byte -scale 0 1757 0 255 mosaico_rer.tif mosaico_rer8.tif
    With the -ot option you can set the output data type, we are using 8 bit (1 byte), and again the output format is GeoTiff, the standard one; so we're not using the -of option. With the -scale option you can define the match between the input (0~1757) and output (0~255) range.

    Now you can use the image in GIMP.
    --
    vehrka

  2. #2
    Community Leader Facebook Connected Ascension's Avatar
    Join Date
    Jun 2008
    Location
    St. Charles, Missouri, United States
    Posts
    8,392

    Post

    Good stuff. I was able to follow along and understand even though I have no knowledge of using real world data. I can see this as being very helpful and useful. Good job.
    If the radiance of a thousand suns was to burst at once into the sky, that would be like the splendor of the Mighty One...I am become Death, the Shatterer of worlds.
    -J. Robert Oppenheimer (father of the atom bomb) alluding to The Bhagavad Gita (Chapter 11, Verse 32)


    My Maps ~ My Brushes ~ My Tutorials ~ My Challenge Maps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •