proximity
- Details
- Last Updated on Tuesday, 29 January 2013 09:26
syntax
- proximity(sourcegrid, kernel)
definition
proximity(sourcegrid, kernel) results in a convolution of a sourcegrid and a kernel matrix. For each cell in the sourcegrid, the values of the cell and it's neighbourhood cells are multiplied with the corresponding values in the kernel taking that cell as the focal point in the kernel matrix. The resulting cell value is the maximum of these multiplications. The resulting value type is float32 or float64, based on the value type of the sourcegrid. The resulting domain unit is the domain unit of the sourcegrid attribute.
description
See the dist2 function for how to configure a focal point matrix and a relweight subitem.
applies to
Attribute sourcegrid with value types:
- float32
- float64
conditions
The domain unit of the sourcegrid attribute needs to be of the value type PointGroup and CanBeDomainUnit.
since version
5.15
example
attribute<float32> proximitygrid (GridDomain):
expr = "proximity(float32(sourcegrid), pot3Range/RelWeight)";
| sourcegrid | ||||
| null | 0 | 0 | 0 | 1 |
| 0 | 0 | 2 | 1 | 1 |
| 0 | 2 | 3 | 3 | 3 |
| 1 | 1 | 1 | 3 | 0 |
| 0 | 1 | 0 | 1 | 3 |
| proximitygrid | ||||
| 0 | 0.18 | 0.23 | 0.18 | 0.18 |
| 0.18 | 0.26 | 0.35 | 0.35 | 0.35 |
| 0.24 | 0.35 | 0.53 | 0.53 | 0.53 |
| 0.18 | 0.26 | 0.35 | 0.53 | 0.35 |
| 0.12 | 0.18 | 0.26 | 0.35 | 0.53 |