Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Display GeoTiff or .asc Rasters in Qt
Forum Updated to NodeBB v4.3 + New Features

Display GeoTiff or .asc Rasters in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • msbtM Offline
    msbtM Offline
    msbt
    wrote on last edited by
    #1

    Hi there!
    I'm building a GUI for a small C-Script which simulates avalanches and debris flows. The embedding of the scripts works fine and everything is as it's supposed to be, input rasters are being used for the calculations, output rasters are converted to geotiff via GDAL.

    Now I would like to select each GeoTiff and display it in the GUI and use basic functions like zoom in/out and identify/analyze a pixel when i click on it (each GeoTiff layer saves different values, like velocity, max. output etc). I tried searching everywhere and I stumble across the same posts over and over again.

    https://forum.qt.io/topic/58198/solved-read-and-display-geotiff-images/2 even marked as solved, but the info is no good
    http://stackoverflow.com/questions/31566544/display-geotiff-images-with-qt also no good

    All I need is to display a GeoTiff or the unconverted .asc Raster (AAIGrid) in the GUI and zoom in/out and select a pixel and read its value, how can that be so hard? :/

    Best regards and thanks for any pointers,
    M

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Doesn't the OpenCV suggestion match your needs ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • msbtM Offline
        msbtM Offline
        msbt
        wrote on last edited by
        #3

        Hi!
        Sorry for the delay - after a long struggle I managed to get opencv compiled with MinGW, working with Qt and now the imageviewer actually works :D

        FYI: That's all that was needed in the end:

        cv::Mat img = cv::imread("image.tif");
        namedWindow("Windowname", WINDOW_NORMAL);
        cv::imshow("Windowname", img);
        

        Next step is reading out the pixel-data, I might get back on that part if I can't manage.

        Thanks

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Do you mean convert a cv::Mat into a QImage ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • msbtM Offline
            msbtM Offline
            msbt
            wrote on last edited by
            #5

            Well no, in ArcGIS/QGIS and the likes you can "identify" a point by clicking on it and get the id/attributes and the value of that raster-layer. The I don't want the RGB data, I need the stored value of that GeoTiff raster (values are altitude, speed, volume, etc).
            Best regards

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved