Hot answers tagged buffer
It is a challenging question to do this in raster because you don't have the opportunity to use the value of the pixel for defining the size of the buffer. Therefore you would need to do the focal filter for each value, as you already said. Here is a possible answer to do it with only 3 filters (I couldn't find less), but not perfectly as mentioned by ...
Another option would be to create separate rasters for each pixel value, in this case 4 rasters, with a condition. Then expand the rasters by a pixel count corresponding to the raster's value (by possibly iterating over a value list). Lastly, join the rasters (either algebraic or spatially), to create one binary raster for the tree crowns.
Vector-based approach This task can be done in three steps: Raster To Point; Buffer (using the VALUE field as buffer field); Feature To Raster. Note: using the buffer field avoids the calculation of a buffer for each crown radius value. Raster-based approach Avoiding the vector-based solution, this problem suggests to use a kind of Cellular Automata ...
from GRASS GIS: v.buffer: -c Don't make caps at the ends of polylines from the interface of v.buffer.distance in QGIS (Processing Toolbox): from the interface of v.buffer.column in QGIS (Processing Toolbox): or use GRASS GIS directly and not the GRASS plugin (as says zimmi)
Here is a pure raster solution in Python 2.7 using numpy and scipy: import numpy as np from scipy import ndimage import matplotlib.pyplot as plt #create tree location matrix with values indicating crown radius A = np.zeros((120,320)) A[60,40] = 1 A[60,80] = 2 A[60,120] = 3 A[60,160] = 4 A[60,200] = 5 A[60,240] = 6 A[60,280] = 7 #plot tree locations fig = ...
If you have the pixel position, the radius and the Midpoint circle algorithm (a variant of the Bresenham Alg.) gives you a clue. IMO it is easy to create a polygon from this approach and I think it easy to implement this in Python. A union of this set of polygons gives you the covering area. Bye Huck
Only top voted, non community-wiki answers of a minimum length are eligible