Skip to content

Commit f73a9c1

Browse files
authored
Merge pull request #16 from lbross/master
Fix glitches with awdb forecast point web service
2 parents 7317446 + 530efe8 commit f73a9c1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

get_AWDB_stations_3.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -796,17 +796,16 @@ def update_forecast_point_ws():
796796
{"field_name": BAGIS_NOTE, "field_type": "TEXT", "field_length": 100} #3
797797
]
798798
LOGGER.info("Adding attribute fields to feature class...")
799-
# check for area field and add if missing
799+
# check for NWCC custom fields and add if missing
800800
fields = ListFields(tmpForecastFc)
801-
802801
for field in FCST_FIELDS:
803-
for afield in fields:
804-
if afield.name == field:
802+
if field in fields:
805803
break
806804
else:
807-
AddField_management(tmpForecastFc, **field)
805+
AddField_management(tmpForecastFc, **field)
806+
LOGGER.info(f"Adding field {field['field_name']} to feature class")
808807
joined_table = AddJoin_management(tmpForecastFc, "stationTriplet", settings.AGO_ACTIVE_FCST_URL, "stationTriplet")
809-
sourceLayer = f"L0{FCST_Active}"
808+
sourceLayer = f"L0{stationsForecast}_{settings.AGO_SUFFIX_ACTIVE}"
810809
# Update huc2
811810
expression = f"updateText(!{sourceLayer}.{HUC2}!)"
812811
codeblock = """

0 commit comments

Comments
 (0)