This project was bootstrapped with Create React App. This readme covers the most used commands, but you can read more about create react app to find other functionality available in this project.
The app is in the directory app/
. To start developing the app, you need to enter that directory and first install the dependencies: npm install
This application uses VSCode devcontainers to normalize the development environment. The project may however be developed and built also without devcontainers. However using the devcontainer guarantees that every developer is using the same development and build environment.
You can read more about devcontainers here.
You can run the development server via npm. This will start the server and any changes to the code will be hot deployed into the browser. The process will open a browser window pointing to the development server automatically.
npm start
Building the application will combine all necessary javascript dependencies and build a static version of the tool. The results will be in the build/
folder:
npm run build
The application uses redux for state management. The react application structure is documented here:
The application is built with React/Redux and the following key components:
Backends and APIs used by the application:
The data for wind damages and the catalogue are read lazily from the APIs when necessary.
To enable the visualisation settings that allow users to choose how bands are visualized, OpenLayers is using WebGL TileLayers. However due to how the features is written in OpenLayers, each TileLayer requires an individual WebGL context. This means that each item visible on a map, OpenLayers uses one WebGL context. These contexts are a limited resource within a browser and this hard limit is shared between all tabs/windows open. This means that having too many items visible (which is especially problematic with Sentine 1 raw imagery, "osakuvat") will cause issues. These issues can range from 1) not all of the items being drawn, 2) other map windows might stop working (due to their context being "stolen" by another window), 3) Tuulituhohaukka interfering with other application in the browser, such as Google Maps, 4) other applications in the browser may interfere with Tuulituhohaukka.
A bug report has been filed with OpenLayers: https://github.com/openlayers/openlayers/issues/12800
This version of the Tuulituhohaukka is an MVP version that is still missing some features that are planned to be added later on. The main future features are: spyglass (or lens) and timeseries components.
The lens is a tool that can be used on map windows. When active, a circular area surrounding the mouse cursor, will show a different layer (or set of layers) than when outside this area. This tool is used to compare changes between two versions of the dataset. In this application, these two versions are defined and selected based on time. Inspection time is the main date selection of the application and that controls which versions of each dataset in the visible maps is shown. A secondary time selection ("comparison date") is required for the lens.
Implementation notes:
src/API/Api.ts:getItemsForDatasetAndTime()
Practical implementation:
The time series tool will show how the value of a dataset develops over time. The values are picked from the center of the map where the crosshairs of the map are.
Implementation notes:
Practical implementation:
app/src/API/Api.ts
needs functionality that will return the N timesteps surrounding inspectionTime for a dataset. These steps should center on inspectionTime and the resulting data should be 1) grouped into timesteps, and 2) each group should contain all item information for that timestepapp/src/Components/Map/
that shows the chartapp/src/API/TimeSeries.ts
. This component should provide an easy to use API that matches the requirement from the React component (most likely: `retrieveTimeSeries(timestepsContainingItems, centerCoordinate, crs) : PromiseAdvanced:
Important considerations: