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?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
  • Check this out: 1. https://gis.stackexchange.com/questions/34891/automating-drawing-of-polygons-square-around-number-of-points-in-qgis 2. https://gis.stackexchange.com/questions/29337/creating-square-buffer-around-point-feature-using-arcgis-for-desktop – Comrade Che Sep 22 '22 at 07:48
  • Do you want to create individual rasters for each tree or one big raster? – BERA Sep 22 '22 at 08:07
  • each tree. is there any tool i can use to do that now that i managed to polygonise multiple point markers into bounding boxes? – Darrell Lim Sep 22 '22 at 08:28

2 Answers2

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

Comrade Che
  • 7,091
  • 27
  • 58
  • TQ. it works. Still need to clip the big raster down to individual trees corresponding to their bounding boxes? – Darrell Lim Sep 22 '22 at 12:14
  • @DarrellLim See update. – Comrade Che Sep 22 '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. :( – Darrell Lim Sep 23 '22 at 09:09
  • @DarrellLim You can create a python script or QGIS model to automate this process. Batch processing can also help you solve this problem. – Comrade Che Sep 23 '22 at 09: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. – Darrell Lim Sep 23 '22 at 10:59
  • @DarrellLim Try this: https://docs.qgis.org/3.22/en/docs/user_manual/processing/modeler.html – Comrade Che Sep 23 '22 at 11:16
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

Erik
  • 16,269
  • 1
  • 24
  • 43