2

I am familiar with the tool Highest Position (Spatial Analyst) in Arcgis, but I am trying to replicate this tools function is QGIS. Is anyone aware if this tool exist in QGIS (possibly under a different name)? I have tried looking but no luck yet. Below is a description of what the tool does in Arcgis.

enter image description here

So the way the Highest Position Tool works in Arcgis is as follows:

  • The order that you added your raster is important for the output:
  • When I add InRas1 to the tool, it is my first input for my stack of rasters. The tool assigns this raster the value of 1
  • When I add InRas2 to the tool, it is my 2nd input for my stack of rasters. The tool assigns this raster the value of 2
  • When I add InRas3 to the tool, it is my third input for my stack of rasters. The tool assigns this raster the value of 3.
  • When the Highest Position tool is run, it is looking at over laying pixels to determine the highest value. In this example I will use the bottom left pixel of inputs InRas1, InRas2 and InRas3. From the illustration, InRas1 has the highest value of 4 and so in the output raster (outRas), the tool assigns that pixel a value of 1 (as this was the first raster in putted into my raster stack. See point 2 above)
4
  • Is there an error in the example image? Why isn't the lower left of the output 4? – alphabetasoup Jul 27 '15 at 7:22
  • 1
    The example is correct, but Ill have to add more information for it to make sense. – TsvGis Jul 27 '15 at 7:28
  • It cant be 4 there are only 3 images =) – julsbreakdown Jul 27 '15 at 7:30
  • 2
    @alpha-beta-soup Read the three rasters as being the 1st, 2nd and 3rd rasters, then the highest value (4) is found in the 1st raster (aka the raster in position 1). Consequently it is 1 (position) that is written for that cell. – PolyGeo Jul 27 '15 at 7:31
4

You could use the raster Calculator something like

(raster1>raster2>raster3)*1 OR  (raster1>raster3>raster2)*1 OR (raster2>raster3>raster1)*2 OR  (raster2>raster1>raster3)*2 OR (raster3>raster2>raster1)*3 OR (raster3>raster1>raster2)*3
4
  • HI, Thanks for the answer but I don't get the 1,2 or 3 representing the highest position when I use it. Using the formula above, I get 1 or 0 in the output. – TsvGis Jul 27 '15 at 22:18
  • (raster1>raster2>raster3) will give you 1 (true), 0 (false). So you multiple the output by 1,2,3 depending on the raster. – julsbreakdown Jul 28 '15 at 7:38
  • I still get the same results of only 2 values or 1 and 0. Ill try a different set of data to see if I get the same result. But your right it should be producing results of 1,2,3 – TsvGis Jul 28 '15 at 22:02
  • On the output layer properties in qgis make sure that the min/max values are real and base on min / max. – julsbreakdown Jul 29 '15 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.