This project is supposed to visualize data generated by the SatSkred project.
The frontend is written in plain TypeScript and utilizes
Highcharts for showing charts, and
OpenLayers for maps. The entry
point is in ts/main.ts and the client compiles into static/js/skredview.js.
The charts are mostly controlled from within ts/charts.ts, and the maps
from within ts/ol.ts, though map layers are set up in ts/ol/layer.ts.
What may be relevant to understand about the frontend is that the statistics were originally calculated on the client, when the amount of detections were a small fraction of the current amount. The statistics aggregation was later moved to the database (or rather to the database queries run by the backend).
You find the backend in src/main.py. It's basically just a home-made
connection pool and some SQL queries. The queries became a bit more extensie
after the statistics calculations were moved here.
The API justs sends the values of the different charts
(/api/events/points/), as well as a GeoJSON
of avalanche geometries /api/events/polygons/within/<w>/<s>/<e>/<n>/.
condanpm
git clone [email protected]:NVE/skredview.git
or
git clone https://github.com/NVE/skredview.git
conda create --file skredview.yml
conda activate skredview
npm install
npm run build
Add usernames and passwords for database and Geonorge in src/settings.py.
python src/main.py 4321