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

Area-based interpolation #1

Open
asinghvi17 opened this issue Apr 23, 2024 · 1 comment
Open

Area-based interpolation #1

asinghvi17 opened this issue Apr 23, 2024 · 1 comment

Comments

@asinghvi17
Copy link
Member

See https://gistbok.ucgis.org/bok-topics/areal-interpolation and https://github.com/chris-prener/areal.

The most basic form is simple and can be done already. Consider a vector of polygons polys, associated values values, and a polygon that we want to interpolate, p1.

In this case, we can simply execute GO.area.(GO.intersection.(polys, (p1,), target = PolygonTrait()) ./ GO.area.(polys) .* values with some normalization factor. However, spatially aware versions of this also exist that could be integrated into Rasters.jl.

That means that area-based interpolation should probably be its own package, accepting GeoInterface geometries and potentially also RTree/STRtree objects to speed up intersection.

FeatureCollections would be decomposed to tables on input. The main entry point should probably return a GI feature. GO.reconstruct would be helpful here.


In order to get raster statistics, we could use something like Rasters.zonal(sum, provided_data; of = polygon). This provides a nice accumulator interface without many allocations. We could also use Stencils.jl to do some stencilling on a fully populated raster, if that proves necessary.

If we do end up using Rasters, then we must mention in many places a method by which you can create a Raster from a regular array.

@asinghvi17
Copy link
Member Author

I just pushed a basic framework up. It still needs support for:

  • intensive vs extensive variables
  • how to reduce (could be sum or mean or something else)
  • more settings/tuning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

1 participant