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

move WCS specs to hosted JSON files #347

Open
dylanbeaudette opened this issue May 3, 2024 · 1 comment
Open

move WCS specs to hosted JSON files #347

dylanbeaudette opened this issue May 3, 2024 · 1 comment

Comments

@dylanbeaudette
Copy link
Member

The FY24 gNATSGO mukey grid was incorrectly exported as INT32 vs. UINT32, with NODATA encoded as -2147483648. WCS specifications are hard-coded in soilDB, but should be hosted server-side, ideally in a JSON file for each suite of WCS variables.

I'll work on making the JSON files on soilweb, then make changes here.

Accidentally found an INT32 NODATA in ND.

library(terra)
library(soilDB)
library(sf)

# https://casoilresource.lawr.ucdavis.edu/gmap/?loc=48.01037,-98.31562,z15
bb <- '-98.3466 47.9967,-98.3466 48.0232,-98.2844 48.0232,-98.2844 47.9967,-98.3466 47.9967'

## assemble AOI polygon into WKT
wkt <- sprintf('POLYGON((%s))', bb)

## init sf polygon
# WGS84 GCS
x <- vect(wkt, crs = 'epsg:4326')

gnatsgo <- mukey.wcs(x, db = 'gNATSGO', res = 30)
rss <- mukey.wcs(x, db = 'rss', res = 30)

# RAT has a bogus entry, due to INT32 coded NA value (-2147483648)
head(cats(gnatsgo)[[1]])

# note single pixel with bogus NA
par(bg = 'red')
plot(gnatsgo)

# what about the little missing pixel, does it exist in RSS?
plot(rss)

# what is going on with that little pixel?
plot(gnatsgo - rss)
@dylanbeaudette
Copy link
Member Author

Also, it seems that the grid system has changed from FY23 → FY24.

image

dylanbeaudette added a commit that referenced this issue May 4, 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