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

Switch NLCD19 Products to Correctly Aligned Layers #3549

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/mmw/apps/geoprocessing_api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@
)

nlcd_override_allowed_values = '", "'.join([
'nlcd-2019-30m-epsg5070-512-byte',
'nlcd-2016-30m-epsg5070-512-byte',
'nlcd-2011-30m-epsg5070-512-byte',
'nlcd-2006-30m-epsg5070-512-byte',
'nlcd-2001-30m-epsg5070-512-byte',
'nlcd-2019-30m-epsg5070-512-uint8raw',
'nlcd-2016-30m-epsg5070-512-uint8raw',
'nlcd-2011-30m-epsg5070-512-uint8raw',
'nlcd-2006-30m-epsg5070-512-uint8raw',
'nlcd-2001-30m-epsg5070-512-uint8raw',
'nlcd-2011-30m-epsg5070-512-int8',
])
LAYER_OVERRIDES = Schema(
Expand All @@ -192,12 +192,12 @@
properties={
'__LAND__': Schema(
type=TYPE_STRING,
example='nlcd-2019-30m-epsg5070-512-byte',
example='nlcd-2019-30m-epsg5070-512-uint8raw',
description='The NLCD layer to use. Valid options are: '
f'"{nlcd_override_allowed_values}". All "-byte" '
f'"{nlcd_override_allowed_values}". All "-uint8raw" '
'layers are from the NLCD19 product. The "-int8" '
'layer is from the NLCD11 product. The default value '
'is NLCD19 2019 "nlcd-2019-30m-epsg5070-512-byte".',
'is NLCD19 2019 "nlcd-2019-30m-epsg5070-512-uint8raw".'
),
'__STREAMS__': Schema(
type=TYPE_STRING,
Expand Down
10 changes: 5 additions & 5 deletions src/mmw/apps/geoprocessing_api/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ def create_layer_overrides_land_not_valid_msg(values):


LAND_LAYER_OVERRIDES = [
'nlcd-2019-30m-epsg5070-512-byte',
'nlcd-2016-30m-epsg5070-512-byte',
'nlcd-2011-30m-epsg5070-512-byte',
'nlcd-2006-30m-epsg5070-512-byte',
'nlcd-2001-30m-epsg5070-512-byte',
'nlcd-2019-30m-epsg5070-512-uint8raw',
'nlcd-2016-30m-epsg5070-512-uint8raw',
'nlcd-2011-30m-epsg5070-512-uint8raw',
'nlcd-2006-30m-epsg5070-512-uint8raw',
'nlcd-2001-30m-epsg5070-512-uint8raw',
'nlcd-2011-30m-epsg5070-512-int8',
]

Expand Down
2 changes: 1 addition & 1 deletion src/mmw/apps/geoprocessing_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def start_analyze_land(request, nlcd_year, format=None):

nlcd, year = nlcd_year.split('_')
if nlcd == '2019' and year in ['2019', '2016', '2011', '2006', '2001']:
layer_overrides['__LAND__'] = f'nlcd-{year}-30m-epsg5070-512-byte'
layer_overrides['__LAND__'] = f'nlcd-{year}-30m-epsg5070-512-uint8raw'

return start_celery_job([
geoprocessing.run.s('nlcd_ara', geop_input, wkaoi,
Expand Down
2 changes: 1 addition & 1 deletion src/mmw/apps/modeling/calcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def get_layer_value(layer, layer_overrides=dict):
If the default config is something like:

{
'__LAND__': 'nlcd-2019-30m-epsg5070-512-byte',
'__LAND__': 'nlcd-2019-30m-epsg5070-512-uint8raw',
'__SOIL__': 'ssurgo-hydro-groups-30m-epsg5070-512-int8',
'__STREAMS__': 'nhd',
}
Expand Down
10 changes: 5 additions & 5 deletions src/mmw/js/src/modeling/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ module.exports = {
layerOverrideToDefaultLandCoverType: function(layer_overrides) {
var raster = layer_overrides && _.get(layer_overrides, "__LAND__"),
mapping = {
"nlcd-2019-30m-epsg5070-512-byte": "land_2019_2019",
"nlcd-2016-30m-epsg5070-512-byte": "land_2019_2016",
"nlcd-2011-30m-epsg5070-512-byte": "land_2019_2011",
"nlcd-2006-30m-epsg5070-512-byte": "land_2019_2006",
"nlcd-2001-30m-epsg5070-512-byte": "land_2019_2001",
"nlcd-2019-30m-epsg5070-512-uint8raw": "land_2019_2019",
"nlcd-2016-30m-epsg5070-512-uint8raw": "land_2019_2016",
"nlcd-2011-30m-epsg5070-512-uint8raw": "land_2019_2011",
"nlcd-2006-30m-epsg5070-512-uint8raw": "land_2019_2006",
"nlcd-2001-30m-epsg5070-512-uint8raw": "land_2019_2001",
"nlcd-2011-30m-epsg5070-512-int8": "land_2011_2011",
};

Expand Down
2 changes: 1 addition & 1 deletion src/mmw/mmw/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def get_env_setting(setting):
'__BFI__': 'bfi48grd-epsg5070',
'__GWN__': 'us-groundwater-nitrogen-30m-epsg5070-512',
'__KFACTOR__': 'us-ssugro-kfactor-30m-epsg5070-512',
'__LAND__': 'nlcd-2019-30m-epsg5070-512-byte',
'__LAND__': 'nlcd-2019-30m-epsg5070-512-uint8raw',
'__NED__': 'ned-nhdplus-30m-epsg5070-512',
'__PROTECTED_LANDS__': 'protected-lands-30m-epsg5070-512',
'__SLOPE__': 'us-percent-slope-30m-epsg5070-512',
Expand Down