Results 1 to 7 of 7

Thread: DEM creation problems

  1. #1
    Guild Member Facebook Connected Thorf's Avatar
    Join Date
    May 2008
    Location
    Akita, Japan
    Posts
    70

    Question DEM creation problems

    So I have DEMs for my project, created in Photoshop and processed in Wilbur. These days I am using GIS software with these too, but I have a problem with the scale: Wilbur allowed me to span the terrain as I needed, but GIS software reads the resulting file as "1 shade of grey = 1 metre". These are 16-bit files, so a mountain that should be 1,300 m is coming out as 19,000.

    This sounds like a problem that would be easy to fix, but searching for anything on editing DEMs, all I can find is people saying, "You can't edit a DEM," "You don't need to edit a DEM," and "Are you crazy? Why would you need to change the scale on a DEM?!?" I'm sure that must make sense for real world DEMs, but it's not much help for fantasy DEMs.

    Does anyone have a solution to this problem? What software would I need, or what would I need to do to set the elevation scale on a DEM file?


    A little addendum about what I want to do: having the DEM display with proper elevation values makes it easy to measure elevation at any point. (Of course, I can already do this measurement in Wilbur.) But I also want to create contour lines using QGIS. This is actually pretty easy, and I don't necessarily even need the right elevation values in order to do this — it would be easy enough to work out a multiplier to turn 19,000 into 1,300 — but it would be even better if the values were correct to begin with.

  2. #2
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,549

    Default

    You can't just span correctly in Wilbur before export?

    I know what you mean about the GIS folks, btw. Those real-world data sets are expensive to obtain and you really don't want to muck about with them.
    Last edited by waldronate; 08-19-2014 at 03:48 AM.

  3. #3
    Guild Member Facebook Connected Thorf's Avatar
    Join Date
    May 2008
    Location
    Akita, Japan
    Posts
    70

    Default

    From what I can see, the problem is that the software I'm using (both QGIS and Geographic Imager) thinks that the DEM is scaled in metres, with the greyscale 16-bit colour range corresponding to metres.

    I have already spanned the terrain to my desired range in Wilbur, with a pure white marker to indicate the top elevation, as per your recommendation. (Thanks!) It has been working great for me like this.

    There are various problems with treating these images as DEM files, though. For a start, Wilbur outputs PNG or MDR, whereas the GIS programs tend to need something else. I have chosen TIF, since it's easily editable in Photoshop, and can hold geographic information too. I'm guessing that the DEM scale information for a regular DEM is encoded in the file's metadata somewhere, but Wilbur's PNGs don't contain that sort of metadata. And since real world DEMs are not generated by everyday users, there doesn't seem to be an option to add or change this metadata.

    It's a bit of a conundrum.

  4. #4
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,549

    Default

    I keep meaning to plop GDAL in the middle of Wilbur, but I always have more paying things to do. You should be able to save the image as a HF2/HFZ file and then use GDAL's gdal_translate ( GDAL: GDAL - Geospatial Data Abstraction Library to get the download ) to produce a format that your GIS will ingest without Wilbur doing inappropriate things to get the maximum scaling for a 16-bit PNG. After you save the HF2 file, fire up a command prompt with the GDAL SDKShell running and try

    gdal_translate -of GTiff filename.hf2

    to do the translation. It's possible that one of the tools may already handle the HF2 format.

  5. #5
    Guild Member Facebook Connected Thorf's Avatar
    Join Date
    May 2008
    Location
    Akita, Japan
    Posts
    70

    Default

    Success!!

    Thank you very much, this was precisely what I needed. So Wilbur is indeed tracking the elevations in a GIS-readable way, as long as you save it in a format that allows them to be saved. It would be great if it could save as GeoTiff, but I know your wanted features list is a mile long.

    In any case this workaround is great. You're a life saver!

  6. #6
    Guild Artisan su_liam's Avatar
    Join Date
    Aug 2007
    Location
    Port Alberta, Regina(IRL: Eugene, OR)
    Posts
    798

    Default

    Quote Originally Posted by waldronate View Post
    I keep meaning to plop GDAL in the middle of Wilbur, but I always have more paying things to do.
    As much as I like to see updates of Wilbur, can't say that's a bad thing...

  7. #7
    Guild Expert johnvanvliet's Avatar
    Join Date
    Jul 2012
    Location
    N 42.39 W 83.44
    Posts
    1,091
    Blog Entries
    4

    Default

    for a Gtiff use GDAL

    DEM's are normally a 16 bit signed image ( -32767 to + 32768 ) in 1 tone = 1 M
    with sealevel set at ZERO

    tiff dose not save to signed format( unsigned or float) you have to convert it to a 32 bit floatingpoint THEN save it as a tiff

    for viewing them Nip2 works great and so dose the terminal version of Gmic ( custom source code build)

Posting Permissions

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