You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently pycnophylactic interpolation does not recognize boundary conditions, and uses NaNs and NaN-aware math, to perform this. This is kind of like a reflected BC?
What I mean by a boundary here is the boundary of the unary union of all polygons in the source feature collection, not the boundary of the domain of "integration"/filtering which is substantially simpler, and already handled by Stencils.jl (the domain here being the Raster).
One way to define a boundary condition would be to first rasterize buffered versions of the geometry, which are all setdiff'ed by each other,
giving each a dedicated exclusionary zone. However, this is a bit difficult to get right, so we instead simply use NaNs for cells not covered by geometry, and then ignore the NaNs when filtering. This does cause some diffusion outward over time, but nothing that can't be handled.
Another potential way to implement this "buffering" would be to set each pixel's value to the value of the nearest polygon - this would require a tree search of some kind, probably, and for points totally outside the extent of the polygons we would have to get distance from every polygon. Then we would pick the distance to the nearest polygon - this would obtain a Neumann boundary condition.
The text was updated successfully, but these errors were encountered:
asinghvi17
changed the title
Pycnophylactic boundary condition thoughts`
Pycnophylactic boundary condition thoughts
May 2, 2024
Currently pycnophylactic interpolation does not recognize boundary conditions, and uses NaNs and NaN-aware math, to perform this. This is kind of like a reflected BC?
What I mean by a boundary here is the boundary of the unary union of all polygons in the source feature collection, not the boundary of the domain of "integration"/filtering which is substantially simpler, and already handled by Stencils.jl (the domain here being the Raster).
One way to define a boundary condition would be to first rasterize buffered versions of the geometry, which are all
setdiff
'ed by each other,giving each a dedicated exclusionary zone. However, this is a bit difficult to get right, so we instead simply use NaNs for cells not covered by geometry, and then ignore the NaNs when filtering. This does cause some diffusion outward over time, but nothing that can't be handled.
Another potential way to implement this "buffering" would be to set each pixel's value to the value of the nearest polygon - this would require a tree search of some kind, probably, and for points totally outside the extent of the polygons we would have to get distance from every polygon. Then we would pick the distance to the nearest polygon - this would obtain a Neumann boundary condition.
The text was updated successfully, but these errors were encountered: