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

feat: climate and weather data #3011

Closed
wants to merge 19 commits into from
Closed
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
259 changes: 242 additions & 17 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2023-09-06T13:08:55.205Z\n"
"PO-Revision-Date: 2023-09-06T13:08:55.205Z\n"
"POT-Creation-Date: 2023-10-25T09:08:21.244Z\n"
"PO-Revision-Date: 2023-10-25T09:08:21.244Z\n"

msgid "Untitled map, {{date}}"
msgstr "Untitled map, {{date}}"
Expand All @@ -29,6 +29,243 @@ msgstr "Legend set"
msgid "Color"
msgstr "Color"

msgid "Weather & Climate"
msgstr "Weather & Climate"

msgid "Air quality"
msgstr "Air quality"

msgid "10 days forecast"
msgstr "10 days forecast"

msgid "Temperature"
msgstr "Temperature"

msgid "Precipitation"
msgstr "Precipitation"

msgid "Climate change"
msgstr "Climate change"

msgid "Close"
msgstr "Close"

msgid "Night"
msgstr "Night"

msgid "Morning"
msgstr "Morning"

msgid "Afternoon"
msgstr "Afternoon"

msgid "Evening"
msgstr "Evening"

msgid "Max/min temp."
msgstr "Max/min temp."

msgid "Precip."
msgstr "Precip."

msgid "Wind"
msgstr "Wind"

msgid "Monthly"
msgstr "Monthly"

msgid "Daily"
msgstr "Daily"

msgid "Clear sky"
msgstr "Clear sky"

msgid "Fair"
msgstr "Fair"

msgid "Partly cloudy"
msgstr "Partly cloudy"

msgid "Cloudy"
msgstr "Cloudy"

msgid "Light rain showers"
msgstr "Light rain showers"

msgid "Rain showers"
msgstr "Rain showers"

msgid "Heavy rain showers"
msgstr "Heavy rain showers"

msgid "Light rain showers and thunder"
msgstr "Light rain showers and thunder"

msgid "Rain showers and thunder"
msgstr "Rain showers and thunder"

msgid "Heavy rain showers and thunder"
msgstr "Heavy rain showers and thunder"

msgid "Light sleet showers"
msgstr "Light sleet showers"

msgid "Sleet showers"
msgstr "Sleet showers"

msgid "Heavy sleet showers"
msgstr "Heavy sleet showers"

msgid "Light sleet showers and thunder"
msgstr "Light sleet showers and thunder"

msgid "Sleet showers and thunder"
msgstr "Sleet showers and thunder"

msgid "Heavy sleet showers and thunder"
msgstr "Heavy sleet showers and thunder"

msgid "Light snow showers"
msgstr "Light snow showers"

msgid "Snow showers"
msgstr "Snow showers"

msgid "Heavy show showers"
msgstr "Heavy show showers"

msgid "Light snow showers and thunder"
msgstr "Light snow showers and thunder"

msgid "Snow showers and thunder"
msgstr "Snow showers and thunder"

msgid "Heavy snow showers and thunder"
msgstr "Heavy snow showers and thunder"

msgid "Light rain"
msgstr "Light rain"

msgid "Rain"
msgstr "Rain"

msgid "Heavy rain"
msgstr "Heavy rain"

msgid "Light rain and thunder"
msgstr "Light rain and thunder"

msgid "Rain and thunder"
msgstr "Rain and thunder"

msgid "Heavy rain and thunder"
msgstr "Heavy rain and thunder"

msgid "Light sleet"
msgstr "Light sleet"

msgid "Sleet"
msgstr "Sleet"

msgid "Heavy sleet"
msgstr "Heavy sleet"

msgid "Light sleet and thunder"
msgstr "Light sleet and thunder"

msgid "Sleet and thunder"
msgstr "Sleet and thunder"

msgid "Heavy sleet and thunder"
msgstr "Heavy sleet and thunder"

msgid "Light snow"
msgstr "Light snow"

msgid "Snow"
msgstr "Snow"

msgid "Heavy snow"
msgstr "Heavy snow"

msgid "Light snow and thunder"
msgstr "Light snow and thunder"

msgid "Snow and thunder"
msgstr "Snow and thunder"

msgid "Heavy snow and thunder"
msgstr "Heavy snow and thunder"

msgid "Fog"
msgstr "Fog"

msgid "Daily precipitation last year"
msgstr "Daily precipitation last year"

msgid "Daily precipitation"
msgstr "Daily precipitation"

msgid "Precipitation last year"
msgstr "Precipitation last year"

msgid "Monthly precipitation"
msgstr "Monthly precipitation"

msgid "Normal precipitation"
msgstr "Normal precipitation"

msgid "Jauary"
msgstr "Jauary"

msgid "February"
msgstr "February"

msgid "March"
msgstr "March"

msgid "April"
msgstr "April"

msgid "May"
msgstr "May"

msgid "June"
msgstr "June"

msgid "July"
msgstr "July"

msgid "August"
msgstr "August"

msgid "September"
msgstr "September"

msgid "October"
msgstr "October"

msgid "November"
msgstr "November"

msgid "December"
msgstr "December"

msgid "Daily temperatures last year"
msgstr "Daily temperatures last year"

msgid "Mean temperature"
msgstr "Mean temperature"

msgid "Temperature range"
msgstr "Temperature range"

msgid "Monthly temperatures last year"
msgstr "Monthly temperatures last year"

msgid "Normal temperature"
msgstr "Normal temperature"

msgid "Size"
msgstr "Size"

Expand Down Expand Up @@ -209,9 +446,6 @@ msgstr "Map download is not supported by your browser. Try Google Chrome or Fire
msgid "Cancel"
msgstr "Cancel"

msgid "Close"
msgstr "Close"

msgid "No organisation units are selected"
msgstr "No organisation units are selected"

Expand Down Expand Up @@ -596,6 +830,9 @@ msgstr "Drill down one level"
msgid "View profile"
msgstr "View profile"

msgid "Weather and climate"
msgstr "Weather and climate"

msgid "Show longitude/latitude"
msgstr "Show longitude/latitude"

Expand Down Expand Up @@ -1068,9 +1305,6 @@ msgstr "meters"
msgid "Elevation above sea-level."
msgstr "Elevation above sea-level."

msgid "Precipitation"
msgstr "Precipitation"

msgid "millimeter"
msgstr "millimeter"

Expand All @@ -1083,9 +1317,6 @@ msgstr ""
"The values are in millimeters within 5 days periods. Updated monthly, "
"during the 3rd week of the following month."

msgid "Temperature"
msgstr "Temperature"

msgid "°C during daytime"
msgstr "°C during daytime"

Expand Down Expand Up @@ -1202,9 +1433,6 @@ msgstr "Equal counts"
msgid "Symbol"
msgstr "Symbol"

msgid "Daily"
msgstr "Daily"

msgid "Weekly"
msgstr "Weekly"

Expand All @@ -1223,9 +1451,6 @@ msgstr "Weekly (Start Sunday)"
msgid "Bi-weekly"
msgstr "Bi-weekly"

msgid "Monthly"
msgstr "Monthly"

msgid "Bi-monthly"
msgstr "Bi-monthly"

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"d3-time": "^3.1.0",
"d3-time-format": "^4.1.0",
"file-saver": "^2.0.5",
"highcharts": "^10.3.3",
"html-to-image": "^1.11.1",
"lodash": "^4.17.21",
"loglevel": "^1.8.1",
Expand Down
Binary file added public/images/weather/01d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/01m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/01n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/02d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/02m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/02n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/03d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/03m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/03n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/05d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/05m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/05n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/06d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/06m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/06n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/07d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/07m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/07n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/08d .png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/08d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/08m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/08n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/09.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/weather/11.png
Binary file added public/images/weather/12.png
Binary file added public/images/weather/13.png
Binary file added public/images/weather/14.png
Binary file added public/images/weather/15.png
Binary file added public/images/weather/20d.png
Binary file added public/images/weather/20m.png
Binary file added public/images/weather/20n.png
Binary file added public/images/weather/21d.png
Binary file added public/images/weather/21m.png
Binary file added public/images/weather/21n.png
Binary file added public/images/weather/22.png
Binary file added public/images/weather/23.png
Binary file added public/images/weather/24d.png
Binary file added public/images/weather/24m.png
Binary file added public/images/weather/24n.png
Binary file added public/images/weather/25d.png
Binary file added public/images/weather/25m.png
Binary file added public/images/weather/25n.png
Binary file added public/images/weather/26d.png
Binary file added public/images/weather/26m.png
Binary file added public/images/weather/26n.png
Binary file added public/images/weather/27d.png
Binary file added public/images/weather/27m.png
Binary file added public/images/weather/27n.png
Binary file added public/images/weather/28d.png
Binary file added public/images/weather/28m.png
Binary file added public/images/weather/28n.png
Binary file added public/images/weather/29d.png
Binary file added public/images/weather/29m.png
Binary file added public/images/weather/29n.png
Binary file added public/images/weather/30.png
Binary file added public/images/weather/31.png
Binary file added public/images/weather/32.png
Binary file added public/images/weather/33.png
Binary file added public/images/weather/34.png
Binary file added public/images/weather/40d.png
Binary file added public/images/weather/40m.png
Binary file added public/images/weather/40n.png
Binary file added public/images/weather/41d .png
Binary file added public/images/weather/41d.png
Binary file added public/images/weather/41m.png
Binary file added public/images/weather/41n.png
Binary file added public/images/weather/42d.png
Binary file added public/images/weather/42m.png
Binary file added public/images/weather/42n.png
Binary file added public/images/weather/43d.png
Binary file added public/images/weather/43m.png
Binary file added public/images/weather/43n.png
Binary file added public/images/weather/44d.png
Binary file added public/images/weather/44m.png
Binary file added public/images/weather/44n.png
Binary file added public/images/weather/45d.png
Binary file added public/images/weather/45m.png
Binary file added public/images/weather/45n.png
Binary file added public/images/weather/46.png
Binary file added public/images/weather/47.png
Binary file added public/images/weather/48.png
Binary file added public/images/weather/49.png
Binary file added public/images/weather/50.png
10 changes: 10 additions & 0 deletions src/actions/climate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as types from '../constants/actionTypes.js'

export const openClimatePanel = (payload) => ({
type: types.CLIMATE_PANEL_OPEN,
payload,
})

export const closeClimatePanel = () => ({
type: types.CLIMATE_PANEL_CLOSE,
})
3 changes: 3 additions & 0 deletions src/components/app/AppLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import cx from 'classnames'
import React, { useState } from 'react'
import { useSelector } from 'react-redux'
import AlertStack from '../alerts/AlertStack.js'
import ClimateModal from '../climate/ClimateModal.js'
import BottomPanel from '../datatable/BottomPanel.js'
import DownloadModeMenu from '../download/DownloadMenubar.js'
import DownloadSettings from '../download/DownloadSettings.js'
Expand All @@ -26,6 +27,7 @@ const AppLayout = () => {
const detailsPanelOpen = useSelector(
(state) => state.ui.rightPanelOpen && !state.orgUnitProfile
)
const showClimate = useSelector((state) => !!state.climate)

const onFileMenuAction = () =>
detailsPanelOpen &&
Expand Down Expand Up @@ -59,6 +61,7 @@ const AppLayout = () => {
<LayerEdit />
<AlertStack />
<OpenAsMapDialog />
{showClimate && <ClimateModal />}
</>
)
}
Expand Down
38 changes: 38 additions & 0 deletions src/components/climate/AirQuality.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import PropTypes from 'prop-types'
import React, { useState, useEffect } from 'react'
import { getAirQuality } from '../../util/earthEngine.js'

// https://medium.com/google-earth/monitoring-air-quality-with-s5p-tropomi-data-4f6b0aebe1c0
// https://medium.com/google-earth/how-nasa-and-google-are-teaming-up-to-understand-and-analyze-air-quality-around-the-world-7c89f6efad3d
// https://www.nature.com/articles/s41598-023-34774-9
// https://www.mdpi.com/2673-4672/3/2/19
// Sentinel-5: https://developers.google.com/earth-engine/datasets/tags/air-quality
// https://developers.google.com/earth-engine/datasets/catalog/ECMWF_CAMS_NRT
// https://atmosphere.copernicus.eu/
// https://forum.atmospherictoolbox.org/t/convert-the-unit-from-molecules-m-2-to-ppm/154/2
// https://www.youtube.com/watch?v=OvDVb_-BDPk
// https://www.mdpi.com/2673-4672/3/2/19
const AirQuality = ({ geometry }) => {
const [data, setData] = useState()

console.log('AirQuality', data)

useEffect(() => {
getAirQuality(geometry).then(setData)
}, [geometry])

useEffect(() => {
if (data) {
// const test = idToDate(data[0].id)
console.log('data', data)
}
}, [data])

return <div>Air quality</div>
}

AirQuality.propTypes = {
geometry: PropTypes.object.isRequired,
}

export default AirQuality
Loading