spatineo / tuulituhohaukka

0 stars 0 forks source link

Tuulituhohaukka APP

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

Devcontainer

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.

Running in development mode

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

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

Implementation details

React app

The application uses redux for state management. The react application structure is documented here:

Architecture

Dependencies

The application is built with React/Redux and the following key components:

Data sources

Backends and APIs used by the application:

The data for wind damages and the catalogue are read lazily from the APIs when necessary.

Known problems

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

Future development

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.

Spyglass / Lens

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.

Lens

Implementation notes:

Practical implementation:

Time series

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.

Time series

Implementation notes:

Practical implementation:

Advanced:

Important considerations: