NIEHS / amadeus

https://niehs.github.io/amadeus/
Other
6 stars 2 forks source link

Retain columns in `calc_covariates` #69

Closed mitchellmanware closed 3 months ago

mitchellmanware commented 5 months ago

Currently, calc_worker limits output to the locs_id, time, levels, and data value columns. It does not return the other columns from locs.

Add retain_columns (or similar name) to allow user to retain all data from locs.

sigmafelix commented 5 months ago

@mitchellmanware For brevity, how about using keep (as keepgeom in terra::vect()) or remove (remove in sf::st_as_sf())?

mitchellmanware commented 5 months ago

I also wanted to limit the number of columns in the output for easier interpretation, but I agree including the geometries with the "locs_id" is essential information.

mitchellmanware commented 5 months ago

@sigmafelix

Update for users to retain extraction location (point or polygon) geometries. I utilized the "WKT" format for the consistency of returning geometries in a single $geometry column.

https://github.com/NIEHS/amadeus/blob/9830c507414e0532876411e2da0f5e11e7621879/R/calculate_covariates_auxiliary.R#L211

sigmafelix commented 5 months ago

@mitchellmanware Thank you for working on this. I suggest setting the argument for returning geometry FALSE as default since polygon WKTs would become massive depending on the data resolution.

mitchellmanware commented 5 months ago

@sigmafelix Default will be FALSE and i have included a note for long geometry strings associated with polygon features.

sigmafelix commented 5 months ago

@mitchellmanware Sounds great, thank you!