2

I am using the "Proximity (raster distance)" tool in QGIS to calculate the distance from each pixel to the nearby forest.

I created the proximity map using the forest raster as input but the output seems all black and the values shown are zeros. I tried to change the symbology and see but its still the same.

Input data: Corine Landcover 2018 with classes 23, 24 and 25 (forest) only and clipped to the extent of Norway. Reprojected in QGIS to ETRS89 / UTM zone 33N - EPSG:25833.

2
  • 1
    Could you please add some additional information to this question. Is your input data projected? If so, what projection are you using? It could be that you are using a geographic Projection, so the output is in degrees and not metres / feet. Oct 24, 2021 at 23:53
  • Yes, it is projected. Actually, the input data is of CLC 2018. I clipped the CLC layer to the extent of Norway and removed all other classes except the forest layers and saved it and reprojected it in QGIS in ETRS89 / UTM zone 33N - EPSG:25833. Oct 25, 2021 at 13:19

1 Answer 1

4

I downloaded the CLC 2018 raster data to test how the Proximity Tool works with this data.

I was able to produce the following output:enter image description here

To do this I:

  1. Kept the CLC data in its own projection
  2. Using the Proximity Tool, I set the "List of Pixel Values" to 24 (which from what I could tell is a forest class)
  3. Ran the Tool

The result did come up as appearing to be all black (as you experienced) but this seemes to be how the raster is presented, with no streching of the pixel values. QGIS is trying to draw the full range of pixel values (0 to 21900 in my case), so everything appears to be black.

This can be fixed one of two ways:

  1. Right-click the result and select "Stretch using current extent", this should normalise the view and you should see pixels representing distance; or
  2. Open the results properties, and open the "Symbology" menu. Choose the render type as Singleband Pseudocolor and play around with the settings. Here is mine: enter image description here

Hit apply and it should present as you wanted it. Just remember the resolution of the image is 100m, so try stick to those intervals. If you want to include more of the classes you can either add them in the Promiximity tool's options or you can Reclass the image identifying those pixel values representing Forest.

UPDATE WITH SOURCE DATA

Here is the data as provided through the WeTransfer link: enter image description here

The legend shows the forest having a pixel value of 23.

Running the proximity tool I set the "List of pixel values" to 23.

enter image description here

The OUTPUT:

enter image description here

I opened the Layer Properties, and the Symbology Tab. Changed the Render Type to "Singleband pseudocolor" Changed the Mode to "Quantile" Changed the "Classes" to 15 Hit the "Classify" button and then Apply

Here is the result:

enter image description here

I think you may be there with your method, just a little refinement in the presentation.

12
  • I did as per your instructions above and still the values are zeros. Oct 29, 2021 at 9:36
  • Can I send you my raster layer that I am trying to create proximity map from? Oct 29, 2021 at 9:36
  • Sure thing. Let me know your choice of file transfer. Nov 1, 2021 at 8:43
  • I can send it through wetransfer. The link is here: we.tl/t-1oXxmEMlT1. Nov 1, 2021 at 13:04
  • Downloaded and it worked...will update the answer with your data Nov 1, 2021 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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