diff --git a/deploy/default/msc-pygeoapi-config.yml b/deploy/default/msc-pygeoapi-config.yml index 990bda19..bba02f30 100644 --- a/deploy/default/msc-pygeoapi-config.yml +++ b/deploy/default/msc-pygeoapi-config.yml @@ -719,30 +719,6 @@ resources: data: ${MSC_PYGEOAPI_ES_URL}/current_conditions id_field: identifier time_field: timestamp - properties: - - identifier - - name - - station_en - - station_fr - - icon - - cond_en - - cond_fr - - temp - - dewpoint - - pres_en - - pres_fr - - prestnd_en - - prestnd_fr - - rel_hum - - speed - - direction_en - - direction_fr - - bearing - - timestamp - - url_en - - url_fr - - national - - nom climate-daily: type: collection diff --git a/msc_pygeoapi/loader/citypageweather_realtime.py b/msc_pygeoapi/loader/citypageweather_realtime.py index dabdf375..5337d7e8 100644 --- a/msc_pygeoapi/loader/citypageweather_realtime.py +++ b/msc_pygeoapi/loader/citypageweather_realtime.py @@ -184,7 +184,12 @@ "type": "integer" }, 'speed': { - "type": "integer" + 'type': 'text', + 'fields': { + 'raw': { + 'type': 'keyword' + } + } }, 'gust': { "type": "integer" @@ -305,9 +310,9 @@ def if_none(self, type_, value): try: if type_ == 'f': - variable = float(value) if value else 'null' + variable = float(value) if value else None elif type_ == 'i': - variable = int(value) if value else 'null' + variable = int(value) if value else None except ValueError: variable = value @@ -484,7 +489,7 @@ def xml2json_cpw(self, wxo_lookup, xml): } } - conditions['properties'] = {key:val for key, val in conditions['properties'].items() if val != 'null'} # noqa + conditions['properties'] = {key:val for key, val in conditions['properties'].items() if val is not None} # noqa return conditions else: