1

enter image description here

I would like to clip a big raster down to individual trees (i.e. each tree corresponding to each bounding box).

The square box you see here is a vector layer of multiple points, I merely changed the marker to a transparent square.

Clipping by raster will not work as the point is not a native polygon but a square marker.

Buffer works to polygonise multiple point markers. However, I still need to clip the big raster down to individual trees.

Are there any tools I can use to achieve this?

3

2 Answers 2

3

Use these QGIS tools to generate a polygon geometry (square) for each individual point:

  1. Buffer
  2. Minimum bounding geometry

An additional tool can be used to create a separate vector file for each polygon:

  1. Split vector layer

And finally clip the raster image:

  1. Clip raster by mask layer

points to squares

6
  • TQ. it works. Still need to clip the big raster down to individual trees corresponding to their bounding boxes? Sep 22 at 12:14
  • @DarrellLim See update. Sep 22 at 12:26
  • I have more than 10,000 trees to clip. Split vector layer will create 10,000 files. Doing it one by one is too time consuming. :( Sep 23 at 9:09
  • @DarrellLim You can create a python script or QGIS model to automate this process. Batch processing can also help you solve this problem. Sep 23 at 9:39
  • Haven't written python script in QGIS before. a lot to read, which function to import, how to call each polygon that sit in geo package file. if you guys have any reference, that will be helpful. I suppose i will have to iterate through the polygon file, and call clip by raster for each i-polygon. Sep 23 at 10:59
2

Buffer each point by half the length of the side of your marker box (in my case the box is 20 by 20 m, hence I buffered with 10).

Choose the square end cap style, and miter for your join style. This produced the hatched red boxes on the left side.

enter image description here

2
  • TQ. it works. Still need to clip the big raster down to individual trees corresponding to their bounding boxes? Sep 22 at 12:13
  • The answer from @Comrade Che clips the raster using the resulting polygons
    – Nikos
    Sep 22 at 12:25

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.