Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pycnophylactic boundary condition thoughts #18

Open
asinghvi17 opened this issue May 2, 2024 · 0 comments
Open

Pycnophylactic boundary condition thoughts #18

asinghvi17 opened this issue May 2, 2024 · 0 comments

Comments

@asinghvi17
Copy link
Member

asinghvi17 commented 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.

@asinghvi17 asinghvi17 changed the title Pycnophylactic boundary condition thoughts` Pycnophylactic boundary condition thoughts May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant