├── backend ├── .dockerignore ├── docs │ ├── authors.rst │ ├── history.rst │ ├── readme.rst │ ├── contributing.rst │ ├── usage.rst │ ├── index.rst │ ├── Makefile │ ├── make.bat │ ├── installation.rst │ └── conf.py ├── tests │ ├── __init__.py │ ├── test_overstroomik_service.py │ ├── test_api.py │ ├── test_pdok.py │ └── test_geoserver.py ├── scripts │ └── test.sh ├── overstroomik_service │ ├── models.py │ ├── __init__.py │ ├── errors.py │ ├── config.py │ ├── validators.py │ ├── main.py │ ├── auto_models.py │ ├── pdok.py │ └── geoserver.py ├── .flake8 ├── mypy.ini ├── requirements.txt ├── HISTORY.rst ├── AUTHORS.rst ├── MANIFEST.in ├── requirements_dev.txt ├── .editorconfig ├── setup.cfg ├── Dockerfile ├── tox.ini ├── setup.py ├── .gitignore ├── README.rst ├── Makefile ├── CONTRIBUTING.rst └── openapi.yaml ├── geoserver ├── data_dir │ ├── gwc │ │ ├── metadata.properties │ │ └── geowebcache.xml │ ├── .gitignore │ ├── global.xml │ ├── gwc-gs.xml │ ├── logging.xml │ ├── data │ │ ├── floodtype.prj │ │ ├── floodtype.qix │ │ ├── floodtype.shx │ │ ├── floodtype.dbf │ │ ├── floodtype.shp │ │ ├── Maximale_waterhoogte_0.sld │ │ ├── Overstroomik_opvullen_combined.prj │ │ ├── plaatsgebonden_kans_totaal_2019_0.prj │ │ ├── Overstroomik_opvullen_combined.tif │ │ ├── plaatsgebonden_kans_totaal_2019_0.dbf │ │ ├── plaatsgebonden_kans_totaal_2019_0.shp │ │ ├── plaatsgebonden_kans_totaal_2019_0.shx │ │ ├── geo_administratieve_grenzen_veiligheidsregios.prj │ │ ├── geo_administratieve_grenzen_veiligheidsregios.shx │ │ ├── MaximaleWaterdiepte_B_PrimairBeschermd_KustKaart5.prj │ │ ├── geo_administratieve_grenzen_veiligheidsregios.dbf │ │ ├── geo_administratieve_grenzen_veiligheidsregios.shp │ │ ├── geo_evacuatie_evacuatiefractie_verwachtingswaarde.shx │ │ ├── MaximaleWaterdiepte_B_PrimairBeschermd_KustKaart5.tif │ │ ├── geo_evacuatie_evacuatiefractie_verwachtingswaarde.dbf │ │ ├── geo_evacuatie_evacuatiefractie_verwachtingswaarde.shp │ │ ├── geo_evacuatie_evacuatiefractie_verwachtingswaarde.sld │ │ ├── MaximaleWaterdiepte_B_PrimairBeschermd_OvergangsgebiedKaart5.prj │ │ ├── MaximaleWaterdiepte_B_PrimairBeschermd_RivierengebiedKaart5.prj │ │ ├── MaximaleWaterdiepte_B_PrimairBeschermd_OvergangsgebiedKaart5.tif │ │ ├── MaximaleWaterdiepte_B_PrimairBeschermd_RivierengebiedKaart5.tif │ │ ├── geo_evacuatie_beschikbaarheid_droge_verdiepingen_gebouwen_nederland.cpg │ │ ├── geo_evacuatie_beschikbaarheid_droge_verdiepingen_gebouwen_nederland.prj │ │ ├── geo_evacuatie_beschikbaarheid_droge_verdiepingen_gebouwen_nederland.dbf │ │ ├── geo_evacuatie_beschikbaarheid_droge_verdiepingen_gebouwen_nederland.shp │ │ └── geo_evacuatie_beschikbaarheid_droge_verdiepingen_gebouwen_nederland.shx │ ├── styles │ │ ├── generic.xml │ │ ├── line.xml │ │ ├── point.xml │ │ ├── polygon.xml │ │ ├── raster.xml │ │ ├── default_line.sld │ │ ├── default_generic.sld │ │ ├── default_point.sld │ │ ├── default_polygon.sld │ │ ├── default_raster.sld │ │ ├── Maximale_waterhoogte.sld │ │ ├── Overstroomd_gebied.sld │ │ └── Droge_verdiepingen_gebouwen.sld │ ├── logs │ │ ├── QUIET_LOGGING.xml │ │ ├── TEST_LOGGING.xml │ │ ├── DEFAULT_LOGGING.xml │ │ ├── PRODUCTION_LOGGING.xml │ │ ├── VERBOSE_LOGGING.xml │ │ ├── GEOSERVER_DEVELOPER_LOGGING.xml │ │ └── GEOTOOLS_DEVELOPER_LOGGING.xml │ ├── security │ │ ├── config.xml │ │ ├── masterpw.digest │ │ ├── masterpw.info │ │ ├── masterpw.xml │ │ ├── rest.properties │ │ ├── geoserver.jceks │ │ ├── layers.properties │ │ ├── services.properties │ │ ├── version.properties │ │ ├── auth │ │ │ └── default │ │ │ │ └── config.xml │ │ ├── filter │ │ │ ├── basic │ │ │ │ └── config.xml │ │ │ ├── form │ │ │ │ └── config.xml │ │ │ ├── anonymous │ │ │ │ └── config.xml │ │ │ ├── contextAsc │ │ │ │ └── config.xml │ │ │ ├── contextNoAsc │ │ │ │ └── config.xml │ │ │ ├── exception │ │ │ │ └── config.xml │ │ │ ├── formLogout │ │ │ │ └── config.xml │ │ │ ├── interceptor │ │ │ │ └── config.xml │ │ │ ├── rememberme │ │ │ │ └── config.xml │ │ │ ├── roleFilter │ │ │ │ └── config.xml │ │ │ ├── sslFilter │ │ │ │ └── config.xml │ │ │ └── restInterceptor │ │ │ │ └── config.xml │ │ ├── masterpw │ │ │ └── default │ │ │ │ ├── passwd │ │ │ │ └── config.xml │ │ ├── role │ │ │ └── default │ │ │ │ ├── config.xml │ │ │ │ ├── roles.xml │ │ │ │ └── roles.xsd │ │ ├── pwpolicy │ │ │ ├── default │ │ │ │ └── config.xml │ │ │ └── master │ │ │ │ └── config.xml │ │ └── usergroup │ │ │ └── default │ │ │ ├── config.xml │ │ │ ├── users.xml │ │ │ └── users.xsd │ ├── workspaces │ │ ├── default.xml │ │ └── overstroomik │ │ │ ├── namespace.xml │ │ │ ├── workspace.xml │ │ │ ├── overstroomik_shp │ │ │ ├── datastore.xml │ │ │ ├── gebiedsindeling_floodtype │ │ │ │ ├── layer.xml │ │ │ │ └── featuretype.xml │ │ │ ├── plaatsgebonden_kans_totaal_2019_0 │ │ │ │ ├── layer.xml │ │ │ │ └── featuretype.xml │ │ │ ├── administratieve_grenzen_veiligheidsregios │ │ │ │ ├── layer.xml │ │ │ │ └── featuretype.xml │ │ │ ├── evac_droge_verdiepingen_gebouwen_nederland │ │ │ │ ├── layer.xml │ │ │ │ └── featuretype.xml │ │ │ └── evacuatie_evacuatiefractie_verwachtingswaarde │ │ │ │ ├── layer.xml │ │ │ │ └── featuretype.xml │ │ │ ├── styles │ │ │ ├── Overstroomd_gebied.sld │ │ │ ├── Overstroomd_gebied.xml │ │ │ ├── Maximale_waterhoogte.sld │ │ │ ├── Maximale_waterhoogte.xml │ │ │ ├── Overstroomde_wegen.sld.bak │ │ │ ├── Droge_verdiepingen_gebouwen.sld │ │ │ ├── Droge_verdiepingen_gebouwen.xml │ │ │ └── Overstroomde_spoorwegen.sld.bak │ │ │ ├── layergroups │ │ │ └── Overstroomik_data.xml │ │ │ ├── doorbraak_kust_extreem │ │ │ ├── coveragestore.xml │ │ │ └── doorbraak_kust_extreem │ │ │ │ ├── layer.xml │ │ │ │ └── coverage.xml │ │ │ ├── doorbraak_rivierengebied_extreem │ │ │ ├── coveragestore.xml │ │ │ └── doorbraak_rivierengebied_extreem │ │ │ │ ├── layer.xml │ │ │ │ └── coverage.xml │ │ │ ├── doorbraak_overgangsgebied_extreem │ │ │ ├── coveragestore.xml │ │ │ └── doorbraak_overgangsgebied_extreem │ │ │ │ ├── layer.xml │ │ │ │ └── coverage.xml │ │ │ ├── overstroomik_opvullen_combined_waterdiepte │ │ │ ├── coveragestore.xml │ │ │ └── overstroomik_opvullen_combined_waterdiepte │ │ │ │ ├── layer.xml │ │ │ │ └── coverage.xml │ │ │ └── overstroomik_opvullen_combined_overstroomd_gebied │ │ │ ├── coveragestore.xml │ │ │ └── overstroomik_opvullen_combined_overstroomd_gebied │ │ │ ├── layer.xml │ │ │ └── coverage.xml │ └── gwc-layers │ │ ├── LayerInfoImpl--15a21390_17545bfb979_-7ffb.xml │ │ ├── LayerInfoImpl--31eb9dff_17544d20899_-7fd1.xml │ │ ├── LayerInfoImpl--31eb9dff_17544d20899_-7fd3.xml │ │ ├── LayerInfoImpl--31eb9dff_17544d20899_-7fdf.xml │ │ ├── LayerInfoImpl--31eb9dff_17544d20899_-7fef.xml │ │ ├── LayerInfoImpl--31eb9dff_17544d20899_-7ff2.xml │ │ ├── LayerInfoImpl--666160e8_17869b23204_-7ff9.xml │ │ ├── LayerInfoImpl-3e91b462_175991b472d_-7feb.xml │ │ ├── LayerInfoImpl-3e91b462_175991b472d_-7fee.xml │ │ ├── LayerInfoImpl-3e91b462_175991b472d_-7ff4.xml │ │ └── LayerGroupInfoImpl--15a21390_17545bfb979_-7ffa.xml └── Dockerfile ├── .gitignore ├── .gitattributes ├── .pyup.yml ├── .github ├── ISSUE_TEMPLATE.md └── workflows │ └── main.yml ├── helm ├── overstroomik │ ├── templates │ │ ├── backend-service.yaml │ │ ├── geoserver-service.yaml │ │ ├── ingress.yaml │ │ ├── backend-hpa.yaml │ │ ├── geoserver-hpa.yaml │ │ ├── backend-deployment.yaml │ │ ├── geoserver-deployment.yaml │ │ └── _helpers.tpl │ ├── .helmignore │ ├── Chart.yaml │ ├── google.yaml │ └── values.yaml └── README.md ├── sig-deploy-teamcity.sh ├── .env.example ├── .travis.yml ├── docker-compose.yml ├── LICENSE ├── README.rst └── tests └── performance └── benchmark.ipynb /backend/.dockerignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc/metadata.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /backend/docs/authors.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../AUTHORS.rst 2 | -------------------------------------------------------------------------------- /backend/docs/history.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../HISTORY.rst 2 | -------------------------------------------------------------------------------- /backend/docs/readme.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../README.rst 2 | -------------------------------------------------------------------------------- /backend/docs/contributing.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../CONTRIBUTING.rst 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | .vscode 3 | geoserver/data_dir/logs/geoserver.log 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | geoserver/data_dir/** filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /backend/tests/__init__.py: -------------------------------------------------------------------------------- 1 | """Unit test package for overstroomik_service.""" 2 | -------------------------------------------------------------------------------- /backend/scripts/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -x 5 | 6 | pytest /app/tests "${@}" 7 | -------------------------------------------------------------------------------- /backend/overstroomik_service/models.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from pydantic import BaseModel 4 | -------------------------------------------------------------------------------- /backend/.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 100 3 | exclude = .git,__pycache__,__init__.py,.mypy_cache,.pytest_cache 4 | -------------------------------------------------------------------------------- /backend/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | plugins = pydantic.mypy 3 | ignore_missing_imports = True 4 | disallow_untyped_defs = True 5 | -------------------------------------------------------------------------------- /backend/requirements.txt: -------------------------------------------------------------------------------- 1 | uvicorn 2 | fastapi 3 | pydantic[dotenv] 4 | httpx 5 | setuptools==65.5.1 6 | starlette==0.25.0 -------------------------------------------------------------------------------- /backend/HISTORY.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | History 3 | ======= 4 | 5 | 0.1.0 (2020-10-15) 6 | ------------------ 7 | 8 | * First release on PyPI. 9 | -------------------------------------------------------------------------------- /backend/docs/usage.rst: -------------------------------------------------------------------------------- 1 | ===== 2 | Usage 3 | ===== 4 | 5 | To use overstroomik-service in a project:: 6 | 7 | import overstroomik_service 8 | -------------------------------------------------------------------------------- /geoserver/data_dir/.gitignore: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:453796db1adea56bc5500faad94c7096e6af046deb7512b72c9b301e09eb6805 3 | size 74 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/global.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7e2dbaecbc0caf29dd934f40752c4a66f5e69b767f62b6aa145d8ad31f732bf2 3 | size 2800 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-gs.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:407c956fa6a3a4e2ea88643121f4ab71b4f79c1de2df9f41d49e7d193e953e8c 3 | size 1543 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/logging.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:812cfd2dd9a8288127e9bcc78a8e1eb12c66dd62219093110226c2f2ad6a7bd3 3 | size 92 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/floodtype.prj: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0179f1933c85d9c5ff64b2313b8b762103eca543b3d9b28bb111f640ee4717f3 3 | size 427 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/floodtype.qix: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:92dc1c598d1b01702db1c2a664d9a26c9192b19efc02df22e4cf82920d463d63 3 | size 3176 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/floodtype.shx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:eb57466b5fba06e735670a9fe5817ec7564c2bc8061e3d46d74ab907b82eaac7 3 | size 1844 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/generic.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:77944bbf79173f1b6e232c2507c4120d4534270291345e805c8f4f744a9e6f69 3 | size 228 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/line.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8dad0fe3c3472494c0dc745ef42375257849b3b106b1e4fa7956e630ef1bd359 3 | size 222 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/point.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f478c18d30e447f99429e7777fca4a6ebaecb2c676e46676292ce200469bbf0c 3 | size 224 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/polygon.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f5477e11ff76eeceb685f43784e4f76707372cf44a0f6992654f39e2a2637a3c 3 | size 228 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/raster.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ef5912e50705ef541b71652814ff3c73fb0f4c248682b55bbb9b6c9c1f47d003 3 | size 226 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/floodtype.dbf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7c22b63504831ae18acb12e5b8ce8a6871ed4af9a2acb7bcaafc9943ac81ccc8 3 | size 53726 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/floodtype.shp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8d933facad3e7e9c568c1c36051988cf1aea425195cc070fb1223096ced933f9 3 | size 16362568 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc/geowebcache.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:06ee39a85b8dd5f9761252045dd484875ee58a9b4fb6945cee877ea6397bf5ac 3 | size 4848 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/logs/QUIET_LOGGING.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6c43a49d9688d8f53df9910fb6ceec2d8121bf23ec4afdab1316e52a5f851b33 3 | size 702 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/logs/TEST_LOGGING.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:aded2dbd982743cc9fafc6bea8c85f026d6d0baa51f5ad64c20fbcc7148df285 3 | size 1513 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2fb2a77f3616d8ec467ab1dac6283b653774ead8fdafc2d04d66078d7d93b595 3 | size 2625 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/masterpw.digest: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4efff21b69e3be38ea6f4aaa85dce1d97f4b12764227b9153571307fffc13bf1 3 | size 72 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/masterpw.info: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:97ca05b5ce026087e2633d2dd6ee15b6f0573605b4188c826d43ef3068b6eb2c 3 | size 192 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/masterpw.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a9b47a240f8df8123e4081548f0f2f8f9cf26737bf4597ccd8ee688629b7b35b 3 | size 73 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/rest.properties: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fd2dfbd56ab5821a042fa2885351e23229f0327222d2a828f3a78d62651ade2d 3 | size 814 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/default_line.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0cbbf91dc00fb76543406334fd55456b1b902926295228bccd067b8b5c6aaecd 3 | size 1199 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/default.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:02f8c17eeb74354fe93c949a0a40c9c4fd762d0f8bf7b7a36efc906c7241fcb7 3 | size 195 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/logs/DEFAULT_LOGGING.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8e5b1bd8b7de01eecaf9299a8f145eaa203d77a669476bb294f4d5fc8f2cea1e 3 | size 2558 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/logs/PRODUCTION_LOGGING.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f362949560da4a901758ac19ad3dc1d7beefbb7d01e2bdf73d305a0cc96e6f60 3 | size 2374 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/logs/VERBOSE_LOGGING.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b47ba5cab39f965a6f472416c8158ccb8ea992cb86ef0a1aaccd3a597b25e49c 3 | size 3888 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/geoserver.jceks: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:73cfeb2a4041c9e2f32910dfe902171877081d93852dce1bdf04b1973ff48870 3 | size 1031 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/layers.properties: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:679adf68a1151fda951fd717b6a1102865b75e0c82952327c09e5ab0453c049d 3 | size 72 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/services.properties: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:16192e73255faf9d886c8b4dae2bb79905d01ef572f4cbcb1d14585b418e9750 3 | size 515 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/version.properties: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f1f38f7b6008fd68723ef55d31b9d2dcb4f487f5985fb1e04a7d0a36e0ab4bad 3 | size 119 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/default_generic.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:aa1e8919c5e4dcda47eebbf71aa9a6101af1b037b147fe187b00ddce9450ae1a 3 | size 2959 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/default_point.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:088e176d5094fef4a3348f9341e091057cc4cf3820134e7e0e86b1b535add652 3 | size 1362 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/default_polygon.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f793fcf6995bfa18e02d16ad691d83f834cee420abf449c3466e642f11d16f11 3 | size 1556 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/default_raster.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0d2ef6397d23b6852cc7f411616e16359bf5748547eda31f6bf9e4219a296af2 3 | size 761 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/Maximale_waterhoogte_0.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:587f6ae6fbef51a5a45f1bb4684963cadb14177654deb61247260765fe300d68 3 | size 2271 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/auth/default/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:67303705928b17f791dd4eb9f572aea4426aabf58855a097d31f73ab3133bb07 3 | size 247 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/basic/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5a36b5832934e1c1aaa89e489b7c6283f09b9885c4b05b189f61a8fa9d40b8f3 3 | size 232 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/form/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9003a413aa39411e05181dd01f1334856ce05204a3ca01934b5508c4a553cb7b 3 | size 326 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/masterpw/default/passwd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b8ee620882e06b803b4d35a529d2f929a16d8a887746b235ddfb0c4913b56c3d 3 | size 32 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/role/default/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:acaea777f4761c5de7edb59248e5f8fd66f8976ac067b845c8fdd54ab72b36ea 3 | size 355 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/role/default/roles.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:72f11682981fa972e9ee2a7f91bbf440c26ec49c0286f5f04d2af29fb86b876c 3 | size 302 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/role/default/roles.xsd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6cf8bb267bd1f3289128013c4d7cd1c2aecf3426ff936e7aa1cc02490a039f6e 3 | size 3526 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/Maximale_waterhoogte.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:587f6ae6fbef51a5a45f1bb4684963cadb14177654deb61247260765fe300d68 3 | size 2271 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/Overstroomd_gebied.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c48ac1dd4825f0cba5b481b04e30e3a6dd23d57adefe46afa1dc670bc2f21a61 3 | size 1101 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/Overstroomik_opvullen_combined.prj: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b9515dfdb5a4827fb262b1c4f848e2e777bf1b36e85c4fd693339d90b12b6518 3 | size 428 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/logs/GEOSERVER_DEVELOPER_LOGGING.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7061b321c50e3fdd53883f1d741979ef984430a7eda6839588fe72255cd3e098 3 | size 3703 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/logs/GEOTOOLS_DEVELOPER_LOGGING.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6d71859e01de779299ca75f72b78105ceef361b548f56064ef1de929c12995aa 3 | size 4632 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/anonymous/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5761122d3a08a7555d7465e712c7e822a46f1b1c0cb7b1b1e4b85e39c5450b3b 3 | size 210 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/contextAsc/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0ba681bbbb58786c41e9267a08ddc5102d829bf3c5628f814b6be33746a6a5fd 3 | size 256 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/contextNoAsc/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:18d8fe30e39a8c7d30ef823a943937bfd70c345113dbe97fccb02d0336cefb09 3 | size 259 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/exception/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:524aa1e1fd3abe8577d33945a5a4b744760b1c37c30f5a5f0960eaf1636b811f 3 | size 201 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/formLogout/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:59215dc236f52198324591e6dbb3a3269f50bb327c52157c0f37958d3adac160 3 | size 305 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/interceptor/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:afcea4ee4a521c80b62947ab760f6e90171e17b0850b17f3035b96e605fbc5bf 3 | size 340 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/rememberme/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2327ab8593c9534892828519038036b86b29cf43ba5d72332fb98c23865fedad 3 | size 214 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/roleFilter/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:dcfe00f4c7da8510a26e5bc707fe1b07b0b6e3317b9bedf8e1a3742a7dea55b3 3 | size 310 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/sslFilter/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:adf54d5436b8cfd480ca1faef99ccc5487800c8a1f00564f3defa562e3770ccf 3 | size 187 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/masterpw/default/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8aa39e8ee36961ed2043b22738cd3d422fc463de4a9e59c1adf1fb5db9d6b189 3 | size 296 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/pwpolicy/default/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:993d042bc8d80f7d5296f296bb4cae641ffcba1c400ce742424d532bd16ecdb7 3 | size 365 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/pwpolicy/master/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3b4be00e211a9d3af53d4b062a34d97bc85c4ed086aa4f58bae5ecdfd9188a03 3 | size 364 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/usergroup/default/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a89f7c950a471d445e449f1cd739aa0f78e4bbce03866505c7c12d76c72ea294 3 | size 391 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/usergroup/default/users.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f97830a95e7889ade4b01d7ec3c658e57c7fa3284a122a558a5c3febde636a0c 3 | size 245 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/usergroup/default/users.xsd: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:10961823d975568c5b8f88b1fd9ac55344e78810ed0053501c045f607158e6bb 3 | size 2962 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/styles/Droge_verdiepingen_gebouwen.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:477566a0c06f4485c4160e307dc1b0fbd019f7bdf734134a256aafaebf4cb165 3 | size 2194 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/namespace.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:739f0a087f5501a2cb3e602e61e291952de4bcca389f1a7be819f4f356efbc9f 3 | size 168 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/workspace.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:02f8c17eeb74354fe93c949a0a40c9c4fd762d0f8bf7b7a36efc906c7241fcb7 3 | size 195 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/plaatsgebonden_kans_totaal_2019_0.prj: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b9515dfdb5a4827fb262b1c4f848e2e777bf1b36e85c4fd693339d90b12b6518 3 | size 428 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/security/filter/restInterceptor/config.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:14b9f70a1b1c3229becae934b02c7eb6221b21df4c136e126a72e5dc120424e1 3 | size 344 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/Overstroomik_opvullen_combined.tif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5f9e7bf33fc30ab39b019a8b9ecdf5cee451410e1045723d936171b64dfccb99 3 | size 178360189 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/plaatsgebonden_kans_totaal_2019_0.dbf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:52ec0796b7dcff8985f103c850e82ed6d500d08780d944c675135a22159949ca 3 | size 8762573 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/plaatsgebonden_kans_totaal_2019_0.shp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:37bef29478d6d2b7d3f5b71e60276965159feadca8c1c72cc5601cca9a3f61e0 3 | size 116719240 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/plaatsgebonden_kans_totaal_2019_0.shx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:57defbf39e7f8df516efb48e4a33d6bfdb7cd6268cddedd3ddd67be904a4488f 3 | size 342044 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_administratieve_grenzen_veiligheidsregios.prj: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0179f1933c85d9c5ff64b2313b8b762103eca543b3d9b28bb111f640ee4717f3 3 | size 427 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_administratieve_grenzen_veiligheidsregios.shx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6fdf0878b6a28dfa274814dc28523b1bc823724a24803eeb87ed9f5cc47655e9 3 | size 300 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_shp/datastore.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cecbcbab213d9810679d4d6b6674fff521ad4f1a4e142643104aeb56da7ad306 3 | size 993 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/styles/Overstroomd_gebied.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:be1ee03ad7e3ad98b37f7fc6b8890d3d5f7d91f15b2bd35de097ea9e2f33c8e3 3 | size 1099 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/styles/Overstroomd_gebied.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:56bb9d861c44bdbda2f181b20da91e77b7358fddd267e9efe22d5ea617ff33ae 3 | size 446 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/MaximaleWaterdiepte_B_PrimairBeschermd_KustKaart5.prj: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b9515dfdb5a4827fb262b1c4f848e2e777bf1b36e85c4fd693339d90b12b6518 3 | size 428 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_administratieve_grenzen_veiligheidsregios.dbf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a2469974b929bc649948604e648a267aada009590654ba38c209bbe9d18df64e 3 | size 13919 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_administratieve_grenzen_veiligheidsregios.shp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d52524e7cfa2a67e78063a24bdf5f34c112d5cae4bae9c3e3990486c537335d7 3 | size 3103092 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_evacuatie_evacuatiefractie_verwachtingswaarde.shx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:eac93bc5b1a638e37d53dc9b4314b5d5d12a22e3534e5c70c43fd6c7833d0f17 3 | size 1132 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-layers/LayerInfoImpl--15a21390_17545bfb979_-7ffb.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b7b3b84428a5ac62cb269a15ceea153235a5fc0a8fc3f50e05cb1bacf74d230d 3 | size 1452 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-layers/LayerInfoImpl--31eb9dff_17544d20899_-7fd1.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:883fb4f07ae8e11cb610d72836a57affc895415d760273a663a8657802baf228 3 | size 929 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-layers/LayerInfoImpl--31eb9dff_17544d20899_-7fd3.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f8bbaca53c554176109f6b582b4ad54e325685cbce3367eea087bd1603484d39 3 | size 925 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-layers/LayerInfoImpl--31eb9dff_17544d20899_-7fdf.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:99b403764d2ae8f2bf8a34d9d8aff2eab25161ffef0fdd3a7e500f69a5ff2ddc 3 | size 959 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-layers/LayerInfoImpl--31eb9dff_17544d20899_-7fef.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b1f7c670cd2ba216bbe906fbf55e3baf419965094b80cf3b901f70d1377d772f 3 | size 1530 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-layers/LayerInfoImpl--31eb9dff_17544d20899_-7ff2.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:00398780e6551c2d6d912357fdfa502b7fec3a2858c924663725c4ddf6923966 3 | size 917 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-layers/LayerInfoImpl--666160e8_17869b23204_-7ff9.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0ae0d4cdc44be24ae30e701e33892e0b172fa06d1a4cc243867d330f8852b983 3 | size 909 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-layers/LayerInfoImpl-3e91b462_175991b472d_-7feb.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6e813b14d06d7215e847376f9feeb5c16a7a155a0c2be4c0433f8a7e2909f3a1 3 | size 942 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-layers/LayerInfoImpl-3e91b462_175991b472d_-7fee.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c72a5474737a0bb3faef1b4114860b6d6157e7ba2dfd3967b0ef4ecc767d51e5 3 | size 941 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-layers/LayerInfoImpl-3e91b462_175991b472d_-7ff4.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7313090fbfeef0271f0b8bdd55e6ba6d0b6b112e545d3e774fe36c689b0feb1d 3 | size 931 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/layergroups/Overstroomik_data.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b309277b08465a776139503b6de64b78870645b17bbc2e799a680b09e38c5d63 3 | size 1615 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/styles/Maximale_waterhoogte.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2932b2446ef828213f403d860f61b7a2781d063b55613dacaa8e9ef51ccfdbbc 3 | size 2269 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/styles/Maximale_waterhoogte.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ca20495d43a7500f513f3dee1c640bb94ab726d0e52d8bfa5ef8f01405c295e6 3 | size 449 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/styles/Overstroomde_wegen.sld.bak: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:91e969d858ecd610866c0659d46a0ce09c5fcc33faf20b51871da29d3fe48f46 3 | size 1297 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/MaximaleWaterdiepte_B_PrimairBeschermd_KustKaart5.tif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d6cce07e06d8e2067321573c01205a4bd01cda33b68db0e9c72f300ab4c4cfc9 3 | size 30095646 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_evacuatie_evacuatiefractie_verwachtingswaarde.dbf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7aa6dc8045a7543f7a49d865587a73f0ce17a2d2e532f1dbd62a8300db8098db 3 | size 167923 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_evacuatie_evacuatiefractie_verwachtingswaarde.shp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:473aba57884e1ea79deec9691fdbaa1df1a117346b895043ed6d4c8906e84bc0 3 | size 2296860 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_evacuatie_evacuatiefractie_verwachtingswaarde.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b7b08d1ad540143d064cb30c7d44386e79f68b9e423c3be44ff7c33f76897a46 3 | size 12730 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/gwc-layers/LayerGroupInfoImpl--15a21390_17545bfb979_-7ffa.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a410ca0561cdcd820c122d5f6f6470dabb25cb92a3c8dae15fba8ce71cbdcebc 3 | size 683 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/doorbraak_kust_extreem/coveragestore.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7ac2a4eae6b30f0452c83c81db19b1916e697e4f08bd79d1c3ad9d751fb69a20 3 | size 542 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/styles/Droge_verdiepingen_gebouwen.sld: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3f281e0d123f97b16ad6348030d024fc37f37cf806bb653717d3113e9c1c8b2c 3 | size 2192 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/styles/Droge_verdiepingen_gebouwen.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a9e4dabe811fd5fe300bfb5afd37092054d0b6b09d61370e2b18455c8d8a5765 3 | size 405 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/styles/Overstroomde_spoorwegen.sld.bak: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:41a421c7ed9de1fc3c3e3046c706ebe2ef062cebd787f7f016151aea254b8aea 3 | size 1304 4 | -------------------------------------------------------------------------------- /.pyup.yml: -------------------------------------------------------------------------------- 1 | # autogenerated pyup.io config file 2 | # see https://pyup.io/docs/configuration/ for all available options 3 | 4 | schedule: every week 5 | update: insecure 6 | requirements: 7 | - backend/requirements_dev.txt 8 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/MaximaleWaterdiepte_B_PrimairBeschermd_OvergangsgebiedKaart5.prj: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b9515dfdb5a4827fb262b1c4f848e2e777bf1b36e85c4fd693339d90b12b6518 3 | size 428 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/MaximaleWaterdiepte_B_PrimairBeschermd_RivierengebiedKaart5.prj: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b9515dfdb5a4827fb262b1c4f848e2e777bf1b36e85c4fd693339d90b12b6518 3 | size 428 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/MaximaleWaterdiepte_B_PrimairBeschermd_OvergangsgebiedKaart5.tif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1b9eef644a9f32f096c13128504b6b6c9057f94be1db1a4818be9f119b9aace5 3 | size 13919307 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/MaximaleWaterdiepte_B_PrimairBeschermd_RivierengebiedKaart5.tif: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:018521cd7a0163088bca99207aef787de18b82358b9377ed1fab99528b1396fb 3 | size 18443597 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/doorbraak_rivierengebied_extreem/coveragestore.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ebc543db6048196d578db770a852f2d075805bcb8e607b657b3521951aea794e 3 | size 573 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_evacuatie_beschikbaarheid_droge_verdiepingen_gebouwen_nederland.cpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:09fc313075748ce8ead962229ed89c919d5a9ff71974ee725a0b48bb87d975a2 3 | size 10 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_evacuatie_beschikbaarheid_droge_verdiepingen_gebouwen_nederland.prj: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0179f1933c85d9c5ff64b2313b8b762103eca543b3d9b28bb111f640ee4717f3 3 | size 427 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/doorbraak_kust_extreem/doorbraak_kust_extreem/layer.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:78f50149dfc37e9dd7d2e4868025ed73193ac1d27b32424dd2b1903061d6c2a1 3 | size 527 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/doorbraak_overgangsgebied_extreem/coveragestore.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6e6e1d74fb87b08a621a2ec25ed69deef83749c38723b2349f508d5ad032d4b1 3 | size 576 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_shp/gebiedsindeling_floodtype/layer.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:039b623528462e3e3767223ac512d50fc2102a06e3fdc6fd66f921ffc190d6ca 3 | size 480 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_evacuatie_beschikbaarheid_droge_verdiepingen_gebouwen_nederland.dbf: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7e71219422f308518b7113065b121426a4df3eaad118a7de6c0548b00e1a37d2 3 | size 321969287 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_evacuatie_beschikbaarheid_droge_verdiepingen_gebouwen_nederland.shp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4dd0c33b1db6a10d6bafdfb93739afa1f6366889fc1f2a2df54323cd88ac3fc1 3 | size 92939632 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/data/geo_evacuatie_beschikbaarheid_droge_verdiepingen_gebouwen_nederland.shx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:523482707898651b8cfc88c360ac61f7f9cc9cca0e0f319f05be285be9c3370e 3 | size 26554252 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/doorbraak_kust_extreem/doorbraak_kust_extreem/coverage.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:11604dd41119c5a4ba5e946646fde8188d26eef8b3c1b8573ebe3414d951ea22 3 | size 4305 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_opvullen_combined_waterdiepte/coveragestore.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7ee60bb850551f50e4c0914aece0dccdffdfb01a373dc90252b1ef7de7f36305 3 | size 565 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_shp/gebiedsindeling_floodtype/featuretype.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:176046019fbece784ca77fab37236e348913f1b8eb6d28de0f11135168dea582 3 | size 2737 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_shp/plaatsgebonden_kans_totaal_2019_0/layer.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c55190fe6bf8c6f40145d872c4e1ed0eb0f5e9a3d0d63c8f63ae9d7099e07bce 3 | size 488 4 | -------------------------------------------------------------------------------- /backend/AUTHORS.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | Credits 3 | ======= 4 | 5 | Development Lead 6 | ---------------- 7 | 8 | * Maarten Pronk 9 | 10 | Contributors 11 | ------------ 12 | 13 | None yet. Why not be the first? 14 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_opvullen_combined_overstroomd_gebied/coveragestore.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:054c53b48a565649e904943fd9052906c9507efb01478925dec17c61e7f70ee1 3 | size 520 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_shp/administratieve_grenzen_veiligheidsregios/layer.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1d4b7b1bddf7ab4f26d5fcfaea13b3d3de75e0c99a7ffa514a2ee0f422be147e 3 | size 555 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_shp/evac_droge_verdiepingen_gebouwen_nederland/layer.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:94865bfd60cdb35d0de9b96a5b61e2ad62182712fd02f5173ed9d7e9aa5230e9 3 | size 497 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_shp/plaatsgebonden_kans_totaal_2019_0/featuretype.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:53d0f51d0ae4416abd1280071911ee50207b0e2123a13013819158701372221c 3 | size 2850 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/doorbraak_rivierengebied_extreem/doorbraak_rivierengebied_extreem/layer.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8e878a9c603bef1d61dce2499345d27a78eb0cc88c0cf0d39e3d2018dac043cb 3 | size 538 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_shp/administratieve_grenzen_veiligheidsregios/featuretype.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fede989102c8855108925e208bcb56f17fef740091a605fb2e70317737e30bca 3 | size 2767 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_shp/evacuatie_evacuatiefractie_verwachtingswaarde/layer.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:79c02521f1ee9f43454a6b930ba4826fac0149c4424b29529b32e552a09da1ff 3 | size 499 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/doorbraak_overgangsgebied_extreem/doorbraak_overgangsgebied_extreem/layer.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ce4c492ec5aa4b0ed3f241d98f9fce8a6426fe6b4d1c2ea77ee0442218e42172 3 | size 537 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/doorbraak_rivierengebied_extreem/doorbraak_rivierengebied_extreem/coverage.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cf81624d529cf173645f7dadd0c8a2eded502f322973496942669844a0748a1d 3 | size 4357 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_shp/evac_droge_verdiepingen_gebouwen_nederland/featuretype.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:28c36954fd7057c9b0ccc25bb60e83bacd3d54979045fd0f42d8a1f70a5edef9 3 | size 2929 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_shp/evacuatie_evacuatiefractie_verwachtingswaarde/featuretype.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ea49fd57275de37109da70c6aa0ff2a5eca9338393657d2f24e2768d9e6e90ac 3 | size 1580 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/doorbraak_overgangsgebied_extreem/doorbraak_overgangsgebied_extreem/coverage.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fe0cd32f5c41bef709686fe01f0ae93281cdd7a45a6a82e45706759accc6b609 3 | size 4383 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_opvullen_combined_waterdiepte/overstroomik_opvullen_combined_waterdiepte/layer.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:65c31d70297c304bd8cf002017af7520fdcb55dbd1e42f7be9e2193ec1ce6560 3 | size 678 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_opvullen_combined_waterdiepte/overstroomik_opvullen_combined_waterdiepte/coverage.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fa2c04e748bf3cc8129866a71fa271104b7d4ddaa0e57f96733e536db59c6b2e 3 | size 4382 4 | -------------------------------------------------------------------------------- /backend/overstroomik_service/__init__.py: -------------------------------------------------------------------------------- 1 | """Top-level package for overstroomik-service.""" 2 | 3 | __author__ = """Maarten Pronk""" 4 | __email__ = "maarten.pronk@deltares.nl" 5 | __version__ = "0.1.0" 6 | 7 | import overstroomik_service.validators # required for monkey patching 8 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_opvullen_combined_overstroomd_gebied/overstroomik_opvullen_combined_overstroomd_gebied/layer.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:08826f0eb3a91900e810e571ccc7cb287dd08a4fbf13c557e3e074f21c2383b8 3 | size 556 4 | -------------------------------------------------------------------------------- /geoserver/data_dir/workspaces/overstroomik/overstroomik_opvullen_combined_overstroomd_gebied/overstroomik_opvullen_combined_overstroomd_gebied/coverage.xml: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:90ff046efb177dbdd36488ea357eed30a7c29fa622ae6970f9a32c8ca5104d49 3 | size 4468 4 | -------------------------------------------------------------------------------- /backend/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include AUTHORS.rst 2 | include CONTRIBUTING.rst 3 | include HISTORY.rst 4 | include LICENSE 5 | include README.rst 6 | 7 | recursive-include tests * 8 | recursive-exclude * __pycache__ 9 | recursive-exclude * *.py[co] 10 | 11 | recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif 12 | -------------------------------------------------------------------------------- /backend/requirements_dev.txt: -------------------------------------------------------------------------------- 1 | -r requirements.txt 2 | pip==23.1 3 | bump2version==1.0.1 4 | wheel==0.38.1 5 | watchdog==0.10.4 6 | flake8==3.8.4 7 | tox==3.20.1 8 | coverage==5.3 9 | Sphinx==3.3.1 10 | twine==3.2.0 11 | 12 | pytest==6.1.2 13 | pytest-runner==5.2 14 | pytest-asyncio==0.14.0 15 | asyncio==3.4.3 16 | 17 | datamodel-code-generator==0.6.7 18 | -------------------------------------------------------------------------------- /backend/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | indent_size = 4 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | charset = utf-8 11 | end_of_line = lf 12 | 13 | [*.bat] 14 | indent_style = tab 15 | end_of_line = crlf 16 | 17 | [LICENSE] 18 | insert_final_newline = false 19 | 20 | [Makefile] 21 | indent_style = tab 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | * overstroomik-service version: 2 | * Python version: 3 | * Operating System: 4 | 5 | ### Description 6 | 7 | Describe what you were trying to get done. 8 | Tell us what happened, what went wrong, and what you expected to happen. 9 | 10 | ### What I Did 11 | 12 | ``` 13 | Paste the command(s) you ran and the output. 14 | If there was a crash, please include the traceback here. 15 | ``` 16 | -------------------------------------------------------------------------------- /backend/docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to overstroomik-service's documentation! 2 | ====================================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Contents: 7 | 8 | readme 9 | installation 10 | usage 11 | modules 12 | contributing 13 | authors 14 | history 15 | 16 | Indices and tables 17 | ================== 18 | * :ref:`genindex` 19 | * :ref:`modindex` 20 | * :ref:`search` 21 | -------------------------------------------------------------------------------- /helm/overstroomik/templates/backend-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ .Values.backend.name }} 5 | labels: 6 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 7 | spec: 8 | type: {{ .Values.backend.service.type }} 9 | ports: 10 | - port: {{ .Values.backend.service.port }} 11 | targetPort: 80 12 | protocol: TCP 13 | selector: 14 | app: {{ .Values.backend.name }} 15 | -------------------------------------------------------------------------------- /helm/overstroomik/templates/geoserver-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ .Values.geoserver.name }} 5 | labels: 6 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 7 | spec: 8 | type: {{ .Values.geoserver.service.type }} 9 | ports: 10 | - port: {{ .Values.geoserver.service.port }} 11 | targetPort: 8080 12 | protocol: TCP 13 | selector: 14 | app: {{ .Values.geoserver.name }} 15 | -------------------------------------------------------------------------------- /sig-deploy-teamcity.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo -e "This scripts downloads the latest zip url of a release zip to https://portal.sig.eu\n" 3 | 4 | # get the current date 5 | date_yymmdd=$(date +%Y%m%d) 6 | 7 | zip_name=deltares_overstroomik_backend_${date_yymmdd}.zip 8 | 9 | echo "filling ${zip_name}" 10 | 11 | 12 | # add the whole directory 13 | zip -r ${zip_name} . 14 | 15 | echo -e "\nNow upload ${zip_name} to https://portal.sig.eu in separate build step\n" 16 | -------------------------------------------------------------------------------- /helm/overstroomik/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | DOMAIN=localhost 2 | DOCKER_IMAGE_BACKEND=deltares/overstroomik-service 3 | DOCKER_IMAGE_GEOSERVER=deltares/overstroomik-geoserver 4 | BACKEND_CORS_ORIGINS=["http://localhost", "http://localhost:4200", "http://localhost:3000", "http://localhost:8080", "https://localhost", "https://localhost:4200", "https://localhost:3000", "https://localhost:8080", "http://dev.asd.com", "https://stag.asd.com", "https://asd.com", "http://local.dockertoolbox.tiangolo.com", "http://localhost.tiangolo.com"] 5 | INSTALL_DEV=true 6 | COMPOSE=true 7 | FETCH_TIMEOUT=60 8 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Config file for automatic testing at travis-ci.com 2 | sudo: required 3 | 4 | services: 5 | - docker 6 | 7 | before_install: 8 | - mv .env.example .env 9 | - docker-compose up -d --build 10 | 11 | script: 12 | - docker-compose exec backend bash scripts/test.sh 13 | 14 | after_success: 15 | - if [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST_BRANCH}" == "" ]; then 16 | docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD ; 17 | docker-compose push ; 18 | fi 19 | 20 | after_script: 21 | - docker-compose down 22 | -------------------------------------------------------------------------------- /backend/setup.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | current_version = 0.1.0 3 | commit = True 4 | tag = True 5 | 6 | [bumpversion:file:setup.py] 7 | search = version='{current_version}' 8 | replace = version='{new_version}' 9 | 10 | [bumpversion:file:overstroomik_service/__init__.py] 11 | search = __version__ = '{current_version}' 12 | replace = __version__ = '{new_version}' 13 | 14 | [bdist_wheel] 15 | universal = 1 16 | 17 | [flake8] 18 | exclude = docs 19 | 20 | [aliases] 21 | # Define setup.py command aliases here 22 | test = pytest 23 | 24 | [tool:pytest] 25 | collect_ignore = ['setup.py'] 26 | 27 | -------------------------------------------------------------------------------- /backend/docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = python -msphinx 7 | SPHINXPROJ = overstroomik_service 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /backend/tests/test_overstroomik_service.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """Tests for `overstroomik_service` package.""" 4 | 5 | import pytest 6 | 7 | 8 | from overstroomik_service import overstroomik_service 9 | 10 | 11 | @pytest.fixture 12 | def response(): 13 | """Sample pytest fixture. 14 | 15 | See more at: http://doc.pytest.org/en/latest/fixture.html 16 | """ 17 | # import requests 18 | # return requests.get('https://github.com/audreyr/cookiecutter-pypackage') 19 | 20 | 21 | def test_content(response): 22 | """Sample pytest test function with the pytest fixture as an argument.""" 23 | # from bs4 import BeautifulSoup 24 | # assert 'GitHub' in BeautifulSoup(response.content).title.string 25 | -------------------------------------------------------------------------------- /backend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim 2 | 3 | # This version builds on top of: 4 | # - buster (debian) 5 | # - python 6 | # - tiangolo/uvicorn-gunicorn 7 | # - tiangolo/uvicorn-gunicorn-fastapi 8 | 9 | # These last 2 images are not always up to date so we do an extra update step 10 | # update and cleanup 11 | RUN apt-get update && apt-get -y upgrade && apt-get clean && rm -rf /var/lib/apt/lists/* 12 | 13 | WORKDIR . 14 | COPY . /app 15 | 16 | # Allow installing dev dependencies to run tests 17 | ARG INSTALL_DEV=false 18 | RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then pip install -r /app/requirements_dev.txt ; else pip install -r /app/requirements.txt ; fi" 19 | 20 | 21 | ENV PYTHONPATH=/app 22 | # See https://github.com/tiangolo/uvicorn-gunicorn-docker#advanced-usage 23 | ENV MODULE_NAME="overstroomik_service.main" 24 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.3" 2 | services: 3 | 4 | geoserver: 5 | image: '${DOCKER_IMAGE_GEOSERVER?Variable not set}:${TAG-latest}' 6 | build: 7 | context: ./geoserver 8 | volumes: 9 | - ./geoserver/data_dir:/var/local/geoserver 10 | ports: 11 | - 8080:8080 12 | 13 | backend: 14 | image: '${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}' 15 | depends_on: 16 | - geoserver 17 | env_file: 18 | - .env 19 | environment: 20 | - SERVER_NAME=${DOMAIN?Variable not set} 21 | - SERVER_HOST=https://${DOMAIN?Variable not set} 22 | build: 23 | context: ./backend 24 | dockerfile: Dockerfile 25 | args: 26 | INSTALL_DEV: ${INSTALL_DEV-false} 27 | volumes: 28 | - ./backend:/app 29 | command: /start-reload.sh 30 | ports: 31 | - "8000:80" 32 | -------------------------------------------------------------------------------- /backend/tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py38, flake8 3 | 4 | [travis] 5 | python = 6 | 3.8: py38 7 | 8 | [testenv:flake8] 9 | basepython = python 10 | deps = flake8 11 | commands = flake8 overstroomik_service tests 12 | 13 | [pytest] 14 | filterwarnings = ignore::DeprecationWarning 15 | 16 | [testenv] 17 | setenv = 18 | PYTHONPATH = {toxinidir} 19 | deps = 20 | -r{toxinidir}/requirements_dev.txt 21 | ; If you want to make tox run the tests with the same versions, create a 22 | ; requirements.txt with the pinned versions and uncomment the following line: 23 | ; -r{toxinidir}/requirements.txt 24 | commands = 25 | pip install -U pip 26 | pytest --basetemp={envtmpdir} 27 | 28 | [testenv:pypy35-asyncio] 29 | basepython = pypy3 30 | 31 | [testenv:py38-asyncio] 32 | ignore_outcome = true 33 | 34 | [testenv:py38-uvloop] 35 | ignore_outcome = true 36 | pip_pre = true -------------------------------------------------------------------------------- /geoserver/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM oscarfonts/geoserver:2.23.0 2 | 3 | ENV GEOSERVER_DATA_DIR /var/local/overstroomik 4 | 5 | # Make data directory 6 | RUN mkdir ${GEOSERVER_DATA_DIR} 7 | 8 | # Tomcat environment 9 | ENV CATALINA_OPTS "-server -Djava.awt.headless=true \ 10 | -Xms768m -Xmx1560m -XX:+UseConcMarkSweepGC -XX:NewSize=48m \ 11 | -DGEOSERVER_DATA_DIR=${GEOSERVER_DATA_DIR}" 12 | 13 | # These last 2 images are not always up to date so we do an extra update step 14 | # update and cleanup 15 | RUN apt-get update && apt-get -y upgrade && apt-get clean && rm -rf /var/lib/apt/lists/* 16 | 17 | # H2 Extension 18 | RUN rm /usr/local/geoserver/WEB-INF/lib/h2-1.1.119.jar 19 | RUN rm -rf /usr/local/tomcat/webapps.dist/* 20 | 21 | # copy data to the geoserver folder 22 | COPY data_dir/ ${GEOSERVER_DATA_DIR} 23 | 24 | # tomcat user right for log 25 | RUN chown -R tomcat:tomcat ${GEOSERVER_DATA_DIR} 26 | 27 | 28 | -------------------------------------------------------------------------------- /helm/overstroomik/templates/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.ingress.enabled -}} 2 | apiVersion: networking.k8s.io/v1 3 | kind: Ingress 4 | metadata: 5 | name: {{ .Values.ingress.name }} 6 | labels: 7 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 8 | {{- with .Values.ingress.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | spec: 13 | rules: 14 | {{- if eq .Values.ingress.environment "rws" }} 15 | - host: {{ .Values.ingress.host }} 16 | http: 17 | {{- else if eq .Values.ingress.environment "google"}} 18 | - http: 19 | {{- end}} 20 | paths: 21 | {{- range .Values.ingress.services}} 22 | - path: {{ .path }} 23 | pathType: ImplementationSpecific 24 | backend: 25 | service: 26 | name: {{ .name }} 27 | port: 28 | number: {{ .port }} 29 | {{- end }} 30 | {{- end }} 31 | -------------------------------------------------------------------------------- /backend/docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=python -msphinx 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | set SPHINXPROJ=overstroomik_service 13 | 14 | if "%1" == "" goto help 15 | 16 | %SPHINXBUILD% >NUL 2>NUL 17 | if errorlevel 9009 ( 18 | echo. 19 | echo.The Sphinx module was not found. Make sure you have Sphinx installed, 20 | echo.then set the SPHINXBUILD environment variable to point to the full 21 | echo.path of the 'sphinx-build' executable. Alternatively you may add the 22 | echo.Sphinx directory to PATH. 23 | echo. 24 | echo.If you don't have Sphinx installed, grab it from 25 | echo.http://sphinx-doc.org/ 26 | exit /b 1 27 | ) 28 | 29 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 30 | goto end 31 | 32 | :help 33 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 34 | 35 | :end 36 | popd 37 | -------------------------------------------------------------------------------- /backend/overstroomik_service/errors.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class Errors(Enum): 5 | 6 | ERROR_GENERAL_NOER = {"errorcode": 0, "status": "No error"} 7 | ERROR_PDOK_NO_RESU = {"errorcode": 1, "status": "No valid result PDOK"} 8 | ERROR_PDOK_NO_RESP = {"errorcode": 2, "status": "No response PDOK"} 9 | ERROR_GEOS_NO_RESP = {"errorcode": 3, "status": "No response geoserver"} 10 | ERROR_GEOS_NO_SMAP = {"errorcode": 4, "status": "No response geoserver map layer"} 11 | ERROR_GENERAL_IMEP = {"errorcode": 5, "status": "Invalid or missing endpoint request"} 12 | ERROR_OUT_OF_BOUND = {"errorcode": 6, "status": "Location is out of bounds"} 13 | ERROR_BY_LOCATION_422 = {"errorcode": 7, "status": "No valid input for parameter or missing parameter search_field, latitude or longitude"} 14 | # ERROR_GENERAL_ERRO = {"errorcode": 103, "status": "Service not available"} 15 | # ERROR_BY_RD_422 = {"errorcode": 104, "status": "No valid input for parameter or missing parameter x or y"} -------------------------------------------------------------------------------- /helm/overstroomik/templates/backend-hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.backend.autoscaling.enabled }} 2 | apiVersion: autoscaling/v2beta1 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ .Values.backend.name }} 6 | labels: 7 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 8 | spec: 9 | scaleTargetRef: 10 | apiVersion: apps/v1 11 | kind: Deployment 12 | name: {{ .Values.backend.name }} 13 | minReplicas: {{ .Values.backend.autoscaling.minReplicas }} 14 | maxReplicas: {{ .Values.backend.autoscaling.maxReplicas }} 15 | metrics: 16 | {{- if .Values.backend.autoscaling.targetCPUUtilizationPercentage }} 17 | - type: Resource 18 | resource: 19 | name: cpu 20 | targetAverageUtilization: {{ .Values.backend.autoscaling.targetCPUUtilizationPercentage }} 21 | {{- end }} 22 | {{- if .Values.backend.autoscaling.targetMemoryUtilizationPercentage }} 23 | - type: Resource 24 | resource: 25 | name: memory 26 | targetAverageUtilization: {{ .Values.backend.autoscaling.targetMemoryUtilizationPercentage }} 27 | {{- end }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /helm/overstroomik/templates/geoserver-hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.geoserver.autoscaling.enabled }} 2 | apiVersion: autoscaling/v2beta1 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ .Values.geoserver.name }} 6 | labels: 7 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 8 | spec: 9 | scaleTargetRef: 10 | apiVersion: apps/v1 11 | kind: Deployment 12 | name: {{ .Values.geoserver.name }} 13 | minReplicas: {{ .Values.geoserver.autoscaling.minReplicas }} 14 | maxReplicas: {{ .Values.geoserver.autoscaling.maxReplicas }} 15 | metrics: 16 | {{- if .Values.geoserver.autoscaling.targetCPUUtilizationPercentage }} 17 | - type: Resource 18 | resource: 19 | name: cpu 20 | targetAverageUtilization: {{ .Values.geoserver.autoscaling.targetCPUUtilizationPercentage }} 21 | {{- end }} 22 | {{- if .Values.geoserver.autoscaling.targetMemoryUtilizationPercentage }} 23 | - type: Resource 24 | resource: 25 | name: memory 26 | targetAverageUtilization: {{ .Values.geoserver.autoscaling.targetMemoryUtilizationPercentage }} 27 | {{- end }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020, Deltares, HKV 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /helm/overstroomik/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: overstroomik 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | appVersion: 1.16.0 24 | -------------------------------------------------------------------------------- /helm/overstroomik/templates/backend-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ .Values.backend.name }} 5 | labels: 6 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 7 | spec: 8 | {{- if not .Values.backend.autoscaling.enabled }} 9 | replicas: {{ .Values.replicaCount }} 10 | {{- end }} 11 | selector: 12 | matchLabels: 13 | app: {{ .Values.backend.name }} 14 | template: 15 | metadata: 16 | {{- with .Values.backend.podAnnotations }} 17 | annotations: 18 | {{- toYaml . | nindent 8 }} 19 | {{- end }} 20 | labels: 21 | app: {{ .Values.backend.name }} 22 | spec: 23 | containers: 24 | - name: overstroomik-backend 25 | image: "{{ .Values.images.backend }}:{{ .Values.images.tag | default .Chart.AppVersion }}" 26 | imagePullPolicy: {{ .Values.images.pullPolicy }} 27 | ports: 28 | - containerPort: 80 29 | env: 30 | {{- range .Values.backend.environment_variables }} 31 | - name: {{ .key }} 32 | value: {{ .value }} 33 | {{- end }} 34 | resources: 35 | {{- toYaml .Values.backend.resources | nindent 12 }} 36 | -------------------------------------------------------------------------------- /backend/tests/test_api.py: -------------------------------------------------------------------------------- 1 | from fastapi.testclient import TestClient 2 | from overstroomik_service.main import app 3 | 4 | 5 | client = TestClient(app) 6 | 7 | 8 | def test_location_lon() -> None: 9 | longitude = 5.0 10 | response = client.get("/by_location", params=dict(longitude=longitude)) 11 | assert response.status_code == 422 12 | content = response.json() 13 | assert "detail" in content 14 | assert "No valid input" in content.get("detail", "") 15 | 16 | 17 | def test_location_latlon() -> None: 18 | longitude = 5.0 19 | latitude = 53.0 20 | response = client.get( 21 | "/by_location", params=dict(longitude=longitude, latitude=latitude) 22 | ) 23 | assert response.status_code == 200 24 | content = response.json() 25 | assert "location" in content 26 | 27 | 28 | def test_location_searchfield() -> None: 29 | search_field = "8243LP<>'" 30 | response = client.get("/by_location", params=dict(search_field=search_field)) 31 | assert response.status_code == 200 32 | content = response.json() 33 | assert "location" in content 34 | assert ( 35 | content.get("location", {}).get("search_field") 36 | == "8243LP&lt;&gt;&#x27;" 37 | ) 38 | -------------------------------------------------------------------------------- /backend/docs/installation.rst: -------------------------------------------------------------------------------- 1 | .. highlight:: shell 2 | 3 | ============ 4 | Installation 5 | ============ 6 | 7 | 8 | Stable release 9 | -------------- 10 | 11 | To install overstroomik-service, run this command in your terminal: 12 | 13 | .. code-block:: console 14 | 15 | $ pip install overstroomik_service 16 | 17 | This is the preferred method to install overstroomik-service, as it will always install the most recent stable release. 18 | 19 | If you don't have `pip`_ installed, this `Python installation guide`_ can guide 20 | you through the process. 21 | 22 | .. _pip: https://pip.pypa.io 23 | .. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/ 24 | 25 | 26 | From sources 27 | ------------ 28 | 29 | The sources for overstroomik-service can be downloaded from the `Github repo`_. 30 | 31 | You can either clone the public repository: 32 | 33 | .. code-block:: console 34 | 35 | $ git clone git://github.com/evetion/overstroomik_service 36 | 37 | Or download the `tarball`_: 38 | 39 | .. code-block:: console 40 | 41 | $ curl -OJL https://github.com/evetion/overstroomik_service/tarball/master 42 | 43 | Once you have a copy of the source, you can install it with: 44 | 45 | .. code-block:: console 46 | 47 | $ python setup.py install 48 | 49 | 50 | .. _Github repo: https://github.com/evetion/overstroomik_service 51 | .. _tarball: https://github.com/evetion/overstroomik_service/tarball/master 52 | -------------------------------------------------------------------------------- /helm/overstroomik/templates/geoserver-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: {{ .Values.geoserver.name }} 5 | labels: 6 | chart: {{ .Chart.Name }}-{{ .Chart.Version }} 7 | spec: 8 | {{- if not .Values.geoserver.autoscaling.enabled }} 9 | replicas: {{ .Values.replicaCount }} 10 | {{- end }} 11 | selector: 12 | matchLabels: 13 | app: {{ .Values.geoserver.name }} 14 | template: 15 | metadata: 16 | {{- with .Values.geoserver.podAnnotations }} 17 | annotations: 18 | {{- toYaml . | nindent 8 }} 19 | {{- end }} 20 | labels: 21 | app: {{ .Values.geoserver.name }} 22 | spec: 23 | containers: 24 | - name: overstroomik-geoserver 25 | image: "{{ .Values.images.geoserver.repository }}:{{ .Values.images.geoserver.tag | default .Chart.AppVersion }}" 26 | imagePullPolicy: {{ .Values.images.pullPolicy }} 27 | ports: 28 | - containerPort: 8080 29 | env: 30 | {{- range .Values.geoserver.environment_variables }} 31 | - name: {{ .key }} 32 | value: {{ .value }} 33 | {{- end }} 34 | resources: 35 | {{- toYaml .Values.geoserver.resources | nindent 12 }} 36 | readinessProbe: 37 | httpGet: 38 | path: /geoserver/wfs?service=wfs&version=1.1.0&request=GetCapabilities 39 | port: 8080 40 | scheme: HTTP 41 | initialDelaySeconds: 20 42 | periodSeconds: 20 43 | failureThreshold: 5 44 | 45 | -------------------------------------------------------------------------------- /backend/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """The setup script.""" 4 | 5 | from setuptools import find_packages, setup 6 | 7 | with open("README.rst") as readme_file: 8 | readme = readme_file.read() 9 | 10 | with open("HISTORY.rst") as history_file: 11 | history = history_file.read() 12 | 13 | requirements = [] 14 | 15 | setup_requirements = [ 16 | "pytest-runner", 17 | ] 18 | 19 | test_requirements = [ 20 | "pytest>=3", 21 | ] 22 | 23 | setup( 24 | author="Maarten Pronk", 25 | author_email="maarten.pronk@deltares.nl", 26 | python_requires=">=3.5", 27 | classifiers=[ 28 | "Development Status :: 2 - Pre-Alpha", 29 | "Intended Audience :: Developers", 30 | "License :: OSI Approved :: MIT License", 31 | "Natural Language :: English", 32 | "Programming Language :: Python :: 3", 33 | "Programming Language :: Python :: 3.5", 34 | "Programming Language :: Python :: 3.6", 35 | "Programming Language :: Python :: 3.7", 36 | "Programming Language :: Python :: 3.8", 37 | ], 38 | description="Kubernetes Deployment for overstroomik backend", 39 | install_requires=requirements, 40 | license="MIT license", 41 | long_description=readme + "\n\n" + history, 42 | include_package_data=True, 43 | keywords="overstroomik_service", 44 | name="overstroomik_service", 45 | packages=find_packages(include=["overstroomik_service", "overstroomik_service.*"]), 46 | setup_requires=setup_requirements, 47 | test_suite="tests", 48 | tests_require=test_requirements, 49 | url="https://github.com/evetion/overstroomik_service", 50 | version="0.1.0", 51 | zip_safe=False, 52 | ) 53 | -------------------------------------------------------------------------------- /backend/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | 58 | # Flask stuff: 59 | instance/ 60 | .webassets-cache 61 | 62 | # Scrapy stuff: 63 | .scrapy 64 | 65 | # Sphinx documentation 66 | docs/_build/ 67 | 68 | # PyBuilder 69 | target/ 70 | 71 | # Jupyter Notebook 72 | .ipynb_checkpoints 73 | 74 | # pyenv 75 | .python-version 76 | 77 | # celery beat schedule file 78 | celerybeat-schedule 79 | 80 | # SageMath parsed files 81 | *.sage.py 82 | 83 | # dotenv 84 | .env 85 | 86 | # virtualenv 87 | .venv 88 | venv/ 89 | ENV/ 90 | 91 | # Spyder project settings 92 | .spyderproject 93 | .spyproject 94 | 95 | # Rope project settings 96 | .ropeproject 97 | 98 | # mkdocs documentation 99 | /site 100 | 101 | # mypy 102 | .mypy_cache/ 103 | 104 | # IDE settings 105 | .vscode/ -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ==================== 2 | overstroomik-service 3 | ==================== 4 | 5 | 6 | .. image:: https://travis-ci.com/Deltares/overstroomik-service.svg?branch=master 7 | :target: https://travis-ci.com/Deltares/overstroomik-service 8 | 9 | .. image:: https://pyup.io/repos/github/Deltares/overstroomik-service/shield.svg 10 | :target: https://pyup.io/repos/github/Deltares/overstroomik-service/ 11 | :alt: Updates 12 | 13 | Kubernetes Deployment for overstroomik backend 14 | 15 | * backend folder for Python app 16 | * etl folder for data migration and geoserver configuration 17 | * geoserver folder for GeoServer installation 18 | 19 | Running 20 | ======= 21 | 22 | We make use of Docker and Docker-compose:: 23 | 24 | docker-compose up -d 25 | 26 | To run integration tests 27 | 28 | docker-compose exec backend bash scripts/test.sh 29 | 30 | No tests should fail, nor should there be any skipped tests. 31 | 32 | Running in a Kubernets cluster 33 | ============================== 34 | 35 | A helm chart is available to install Overstroomik in a Kubernetes cluster:: 36 | 37 | helm install overstroomik helm/overstroomik 38 | 39 | By default ingress is disabled. port-forward can be used to access the pods in your local cluster. First get the name of the deployed pod:: 40 | 41 | kubectl get pods 42 | 43 | Create port-forward to access the pod from localhost. Geoserver is running on port 8080 and the backend on 80:: 44 | 45 | kubectl port-forward : 46 | 47 | Ingress and autoscaling can be enabled in helm/values.yaml. Update the installation with changed configuration:: 48 | 49 | helm upgrade overstroomik helm/overstroomik 50 | 51 | Delete the instalation:: 52 | 53 | helm delete overstroomik 54 | 55 | 56 | -------------------------------------------------------------------------------- /helm/overstroomik/google.yaml: -------------------------------------------------------------------------------- 1 | # Default values for overstroomik. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 1 6 | 7 | images: 8 | geoserver: 9 | repository: deltares/overstroomik-geoserver 10 | tag: "latest" 11 | backend: deltares/overstroomik-service 12 | pullPolicy: IfNotPresent 13 | # Overrides the image tag whose default is the chart appVersion. 14 | tag: "latest" 15 | imagePullSecrets: [] 16 | 17 | geoserver: 18 | name: "overstroomik-geoserver" 19 | podAnnotations: {} 20 | 21 | service: 22 | type: NodePort 23 | port: 8080 24 | 25 | autoscaling: 26 | enabled: true 27 | minReplicas: 1 28 | maxReplicas: 5 29 | targetCPUUtilizationPercentage: 40 30 | # targetMemoryUtilizationPercentage: 80 31 | 32 | resources: {} 33 | 34 | backend: 35 | name: "overstroomik-backend" 36 | podAnnotations: {} 37 | 38 | service: 39 | type: NodePort 40 | port: 80 41 | 42 | autoscaling: 43 | enabled: true 44 | minReplicas: 1 45 | maxReplicas: 5 46 | targetCPUUtilizationPercentage: 40 47 | # targetMemoryUtilizationPercentage: 80 48 | 49 | resources: {} 50 | environment_variables: 51 | GEOSERVER_URL: http://overstroomik-geoserver:8080/geoserver 52 | https_proxy: null 53 | 54 | ingress: 55 | environment: google 56 | enabled: true 57 | annotations: 58 | # gcloud compute addresses create overstroomik-static-ip --global 59 | # gcloud endpoints services deploy openapi.yaml 60 | kubernetes.io/ingress.global-static-ip-name: "overstroomik-static-ip" 61 | services: 62 | - name: overstroomik-geoserver 63 | path: /geoserver/* 64 | port: 8080 65 | - name: overstroomik-backend 66 | path: /* 67 | port: 80 68 | -------------------------------------------------------------------------------- /backend/README.rst: -------------------------------------------------------------------------------- 1 | ==================== 2 | overstroomik-service 3 | ==================== 4 | 5 | 6 | .. image:: https://travis-ci.com/Deltares/overstroomik-service.svg?branch=master 7 | :target: https://travis-ci.com/Deltares/overstroomik-service 8 | 9 | .. image:: https://pyup.io/repos/github/Deltares/overstroomik-service/shield.svg 10 | :target: https://pyup.io/repos/github/Deltares/overstroomik-service/ 11 | :alt: Updates 12 | 13 | 14 | 15 | Kubernetes Deployment for overstroomik backend 16 | 17 | 18 | * Free software: MIT license 19 | * Documentation: https://overstroomik-service.readthedocs.io. 20 | 21 | Installation 22 | ------------ 23 | pip install -r requirements_dev.txt 24 | 25 | Running 26 | ------- 27 | "make run" or "uvicorn overstroomik_service.main:app --reload" 28 | 29 | Testing 30 | ------- 31 | "make test" or "pytest" 32 | 33 | Generating 34 | ---------- 35 | 36 | Part of the models used can be autogenerated based on the openAPI spec here: https://app.swaggerhub.com/apis/overstroomik/overstroomik.nl/1.0.0 37 | Run "make generate" or:: 38 | 39 | wget "https://app.swaggerhub.com/apiproxy/registry/overstroomik/overstroomik.nl/1.0.0?resolved=true&pretty=true" -O openapi.yaml 40 | datamodel-codegen --input openapi.yaml --output overstroomik_service/auto_models.py 41 | 42 | Note you could also install fastapi-code-generator to generate a FastAPI app. It's useful in case the service endpoint changes:: 43 | 44 | fastapi-codegen -i openapi.yaml -o app 45 | 46 | You can now copy the relevant parts of the app/main.py into our own package. 47 | 48 | 49 | Features 50 | -------- 51 | 52 | * TODO 53 | 54 | Credits 55 | ------- 56 | 57 | This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template. 58 | 59 | .. _Cookiecutter: https://github.com/audreyr/cookiecutter 60 | .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage 61 | -------------------------------------------------------------------------------- /helm/overstroomik/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for overstroomik. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | replicaCount: 1 6 | 7 | images: 8 | geoserver: 9 | repository: deltares/overstroomik-geoserver 10 | tag: "latest" 11 | backend: deltares/overstroomik-service 12 | pullPolicy: IfNotPresent 13 | # Overrides the image tag whose default is the chart appVersion. 14 | tag: "latest" 15 | imagePullSecrets: [] 16 | 17 | geoserver: 18 | name: "overstroomik-geoserver" 19 | podAnnotations: {} 20 | 21 | service: 22 | type: ClusterIP 23 | port: 8080 24 | 25 | autoscaling: 26 | enabled: false 27 | minReplicas: 1 28 | maxReplicas: 100 29 | targetCPUUtilizationPercentage: 80 30 | # targetMemoryUtilizationPercentage: 80 31 | 32 | resources: {} 33 | 34 | environment_variables: 35 | - key: JAVA_OPTS 36 | value: "-Xms8192m -Xmx8192m -Xss4m -DGEOSERVER_CONSOLE_DISABLED=true" 37 | 38 | backend: 39 | name: "overstroomik-backend" 40 | podAnnotations: {} 41 | 42 | service: 43 | type: ClusterIP 44 | port: 80 45 | 46 | autoscaling: 47 | enabled: false 48 | minReplicas: 1 49 | maxReplicas: 100 50 | targetCPUUtilizationPercentage: 80 51 | # targetMemoryUtilizationPercentage: 80 52 | 53 | resources: {} 54 | environment_variables: 55 | - key: https_proxy 56 | value: webproxy.rws.nl:8080 57 | - key: GEOSERVER_URL 58 | value: http://overstroomik-geoserver:8080/geoserver 59 | 60 | ingress: 61 | environment: rws 62 | name: overstroomik 63 | host: overstroomik.k8s.shared.cnap.intranet.rws.nl 64 | enabled: true 65 | annotations: {} 66 | # gcloud compute addresses create overstroomik-static-ip --global 67 | # gcloud endpoints services deploy openapi.yaml 68 | # kubernetes.io/ingress.global-static-ip-name: "overstroomik-static-ip" 69 | services: 70 | - name: overstroomik-geoserver 71 | path: /geoserver/ 72 | port: 8080 73 | - name: overstroomik-backend 74 | path: / 75 | port: 80 76 | -------------------------------------------------------------------------------- /helm/overstroomik/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Expand the name of the chart. 3 | */}} 4 | {{- define "overstroomik.name" -}} 5 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 6 | {{- end }} 7 | 8 | {{/* 9 | Create a default fully qualified app name. 10 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 11 | If release name contains chart name it will be used as a full name. 12 | */}} 13 | {{- define "overstroomik.fullname" -}} 14 | {{- if .Values.fullnameOverride }} 15 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 16 | {{- else }} 17 | {{- $name := default .Chart.Name .Values.nameOverride }} 18 | {{- if contains $name .Release.Name }} 19 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 20 | {{- else }} 21 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 22 | {{- end }} 23 | {{- end }} 24 | {{- end }} 25 | 26 | {{/* 27 | Create chart name and version as used by the chart label. 28 | */}} 29 | {{- define "overstroomik.chart" -}} 30 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 31 | {{- end }} 32 | 33 | {{/* 34 | Common labels 35 | */}} 36 | {{- define "overstroomik.labels" -}} 37 | helm.sh/chart: {{ include "overstroomik.chart" . }} 38 | {{ include "overstroomik.selectorLabels" . }} 39 | {{- if .Chart.AppVersion }} 40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 41 | {{- end }} 42 | app.kubernetes.io/managed-by: {{ .Release.Service }} 43 | {{- end }} 44 | 45 | {{/* 46 | Selector labels 47 | */}} 48 | {{- define "overstroomik.selectorLabels" -}} 49 | app.kubernetes.io/name: {{ include "overstroomik.name" . }} 50 | app.kubernetes.io/instance: {{ .Release.Name }} 51 | {{- end }} 52 | 53 | {{/* 54 | Create the name of the service account to use 55 | */}} 56 | {{- define "overstroomik.serviceAccountName" -}} 57 | {{- if .Values.serviceAccount.create }} 58 | {{- default (include "overstroomik.fullname" .) .Values.serviceAccount.name }} 59 | {{- else }} 60 | {{- default "default" .Values.serviceAccount.name }} 61 | {{- end }} 62 | {{- end }} 63 | -------------------------------------------------------------------------------- /backend/overstroomik_service/config.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from typing import List, Union 3 | 4 | from pydantic import AnyHttpUrl, BaseSettings, validator 5 | 6 | 7 | class Settings(BaseSettings): 8 | # BACKEND_CORS_ORIGINS is a JSON-formatted list of origins 9 | # e.g: '["http://localhost", "http://localhost:4200", "http://localhost:3000", \ 10 | # "http://localhost:8080", "http://local.dockertoolbox.tiangolo.com"]' 11 | BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = [] 12 | PORT: int = 8000 13 | FETCH_TIMEOUT: float = 10.0 14 | GEOSERVER_URL: str = "http://geoserver:8080/geoserver" 15 | GEOSERVER_LAYER: str = "overstroomik:Overstroomik_data" 16 | openapi_url: str = "/openapi.json" 17 | 18 | WS_VERSION: str = "1.0.0" 19 | COMPOSE: bool = False 20 | 21 | grouplayer_extent_rd: dict = { 22 | "min_x": float(634), 23 | "min_y": float(306594), 24 | "max_x": float(284300), 25 | "max_y": float(636981), 26 | } 27 | 28 | data_layers: list = [ 29 | { 30 | "property": "maximum_water_depth", 31 | "layer": "", # "overstroomik_opvullen_combined_waterdiepte", 32 | "field": "GRAY_INDEX", 33 | }, 34 | { 35 | "property": "safety_board_id", 36 | "layer": "administratieve_grenzen_veiligheidsregios", 37 | "field": "id", 38 | }, 39 | { 40 | "property": "probability_of_flooding", 41 | "layer": "plaatsgebonden_kans_totaal_2019_0", 42 | "field": "DUIDING", 43 | }, 44 | { 45 | "property": "evacuation_percentage", 46 | "layer": "evacuatie_evacuatiefractie_verwachtingswaarde", 47 | "field": "VERWACHTIN", 48 | }, 49 | { 50 | "property": "flood_type", 51 | "layer": "gebiedsindeling_floodtype", 52 | "field": "status", 53 | }, 54 | ] 55 | 56 | @validator("BACKEND_CORS_ORIGINS", pre=True) 57 | def assemble_cors_origins(cls, v: Union[str, List[str]]) -> Union[List[str], str]: 58 | if isinstance(v, str) and not v.startswith("["): 59 | return [i.strip() for i in v.split(",")] 60 | elif isinstance(v, (list, str)): 61 | return v 62 | raise ValueError(v) 63 | 64 | class Config: 65 | case_sensitive = True 66 | 67 | 68 | settings = Settings() 69 | logging.warning(settings) 70 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Docker Compose Actions Workflow 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | tags: 7 | - '*' 8 | pull_request: 9 | branches: [ master ] 10 | 11 | jobs: 12 | test: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout github repo (+ download lfs dependencies) 16 | uses: actions/checkout@v2 17 | with: 18 | lfs: true 19 | - name: Checkout LFS objects 20 | run: git lfs checkout 21 | - name: set environment variables 22 | run: mv .env.example .env 23 | - name: Build the stack 24 | run: docker-compose up -d --build 25 | - name: Test 26 | run: docker-compose exec -T backend bash scripts/test.sh 27 | 28 | release: 29 | if: github.ref == 'refs/heads/master' 30 | needs: test 31 | runs-on: ubuntu-latest 32 | steps: 33 | - name: Checkout github repo (+ download lfs dependencies) 34 | uses: actions/checkout@v2 35 | with: 36 | lfs: true 37 | - name: Checkout LFS objects 38 | run: git lfs checkout 39 | - name: set environment variables 40 | run: mv .env.example .env 41 | - name: Login to Docker Hub 42 | uses: docker/login-action@v1 43 | with: 44 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 45 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 46 | 47 | - name: Build the stack 48 | run: docker-compose build 49 | 50 | - name: Push the stack 51 | run: docker-compose push 52 | 53 | release-version: 54 | if: startsWith(github.ref, 'refs/tags/') 55 | needs: test 56 | runs-on: ubuntu-latest 57 | steps: 58 | - name: Checkout github repo (+ download lfs dependencies) 59 | uses: actions/checkout@v2 60 | with: 61 | lfs: true 62 | - name: Checkout LFS objects 63 | run: git lfs checkout 64 | - name: set environment variables 65 | run: mv .env.example .env 66 | - name: set tag 67 | run: echo "TAG=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> .env 68 | - name: Login to Docker Hub 69 | uses: docker/login-action@v1 70 | with: 71 | username: ${{ secrets.DOCKER_HUB_USERNAME }} 72 | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} 73 | 74 | - name: Build the stack 75 | run: docker-compose build 76 | 77 | - name: Push the stack 78 | run: docker-compose push 79 | 80 | 81 | -------------------------------------------------------------------------------- /backend/overstroomik_service/validators.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from html import escape 3 | from pydantic.class_validators import Validator 4 | 5 | from .auto_models import Data, FloodType, ProbabilityOfFlooding, Location 6 | 7 | 8 | def validate_maximum_water_depth(cls, value): 9 | """Return 0.0 for waterdepth in case of invalid values. 10 | 11 | Invalid values are: 12 | - everything lower than 0.01m (including -9999, -inf) 13 | - everything above 50m as it's unrealistic (including inf) 14 | """ 15 | # in the case that the value is a "100.0" we won't catch it 16 | if isinstance(value, (float, int)): 17 | if value < 0.01: 18 | value = 0.0 19 | 20 | elif value > 50.0: 21 | value = 0.0 22 | 23 | return value 24 | 25 | 26 | def validator_probability_of_flooding(cls, value): 27 | 28 | # No action as the enum parse is passed 29 | if isinstance(value, ProbabilityOfFlooding): 30 | return value 31 | else: 32 | try: 33 | return ProbabilityOfFlooding(str(value).lower()) 34 | except ValueError: 35 | logging.exception(f"Failed converting {value} into ProbabilityOfFlooding") 36 | return None 37 | 38 | 39 | def validator_flood_type(cls, value): 40 | # TODO Make this generic based on the field type in cls 41 | # No action as the enum parse is passed 42 | if isinstance(value, FloodType): 43 | return value 44 | else: 45 | try: 46 | return FloodType(str(value).lower()) 47 | except ValueError: 48 | logging.exception(f"Failed converting {value} into FloodType") 49 | return None 50 | 51 | 52 | def validate_search_string(cls, value): 53 | """Strip search_field for evil chars used in XSS/SQL injection.""" 54 | return escape(value, quote=True) if value is not None else value 55 | 56 | 57 | # We monkey patch the fields of the autogenerated models here 58 | # as otherwise the validators will be overwritten 59 | Data.__fields__["maximum_water_depth"].class_validators = { 60 | "maximum_water_depth": Validator(validate_maximum_water_depth, pre=True) 61 | } 62 | Data.__fields__["maximum_water_depth"].populate_validators() 63 | 64 | Data.__fields__["probability_of_flooding"].class_validators = { 65 | "probability_of_flooding": Validator(validator_probability_of_flooding, pre=True) 66 | } 67 | Data.__fields__["probability_of_flooding"].populate_validators() 68 | 69 | Data.__fields__["flood_type"].class_validators = { 70 | "flood_type": Validator(validator_flood_type, pre=True) 71 | } 72 | Data.__fields__["flood_type"].populate_validators() 73 | Location.__fields__["search_field"].class_validators = { 74 | "search_field": Validator(validate_search_string, pre=True) 75 | } 76 | Location.__fields__["search_field"].populate_validators() 77 | -------------------------------------------------------------------------------- /backend/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean clean-test clean-pyc clean-build docs help 2 | .DEFAULT_GOAL := help 3 | 4 | define BROWSER_PYSCRIPT 5 | import os, webbrowser, sys 6 | 7 | from urllib.request import pathname2url 8 | 9 | webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) 10 | endef 11 | export BROWSER_PYSCRIPT 12 | 13 | define PRINT_HELP_PYSCRIPT 14 | import re, sys 15 | 16 | for line in sys.stdin: 17 | match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) 18 | if match: 19 | target, help = match.groups() 20 | print("%-20s %s" % (target, help)) 21 | endef 22 | export PRINT_HELP_PYSCRIPT 23 | 24 | BROWSER := python -c "$$BROWSER_PYSCRIPT" 25 | 26 | help: 27 | @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) 28 | 29 | clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts 30 | 31 | clean-build: ## remove build artifacts 32 | rm -fr build/ 33 | rm -fr dist/ 34 | rm -fr .eggs/ 35 | find . -name '*.egg-info' -exec rm -fr {} + 36 | find . -name '*.egg' -exec rm -f {} + 37 | 38 | clean-pyc: ## remove Python file artifacts 39 | find . -name '*.pyc' -exec rm -f {} + 40 | find . -name '*.pyo' -exec rm -f {} + 41 | find . -name '*~' -exec rm -f {} + 42 | find . -name '__pycache__' -exec rm -fr {} + 43 | 44 | clean-test: ## remove test and coverage artifacts 45 | rm -fr .tox/ 46 | rm -f .coverage 47 | rm -fr htmlcov/ 48 | rm -fr .pytest_cache 49 | 50 | lint: ## check style with flake8 51 | flake8 overstroomik_service tests 52 | 53 | test: ## run tests quickly with the default Python 54 | pytest 55 | 56 | test-all: ## run tests on every Python version with tox 57 | tox 58 | 59 | coverage: ## check code coverage quickly with the default Python 60 | coverage run --source overstroomik_service -m pytest 61 | coverage report -m 62 | coverage html 63 | $(BROWSER) htmlcov/index.html 64 | 65 | docs: ## generate Sphinx HTML documentation, including API docs 66 | rm -f docs/overstroomik_service.rst 67 | rm -f docs/modules.rst 68 | sphinx-apidoc -o docs/ overstroomik_service 69 | $(MAKE) -C docs clean 70 | $(MAKE) -C docs html 71 | $(BROWSER) docs/_build/html/index.html 72 | 73 | servedocs: docs ## compile the docs watching for changes 74 | watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . 75 | 76 | release: dist ## package and upload a release 77 | twine upload dist/* 78 | 79 | dist: clean ## builds source and wheel package 80 | python setup.py sdist 81 | python setup.py bdist_wheel 82 | ls -l dist 83 | 84 | install: clean ## install the package to the active Python's site-packages 85 | python setup.py install 86 | 87 | run: 88 | uvicorn overstroomik_service.main:app 89 | 90 | generate: # Autogenerate the models based on openAPI spec 91 | wget --output-document=openapi.yaml "https://app.swaggerhub.com/apiproxy/registry/overstroomik/overstroomik.nl/1.0.0?resolved=true&pretty=true" 92 | datamodel-codegen --input openapi.yaml --output overstroomik_service/auto_models.py 93 | -------------------------------------------------------------------------------- /backend/overstroomik_service/main.py: -------------------------------------------------------------------------------- 1 | import logging 2 | from typing import Optional 3 | 4 | import uvicorn 5 | from fastapi import FastAPI, HTTPException 6 | from fastapi.middleware.cors import CORSMiddleware 7 | 8 | from overstroomik_service.auto_models import Data, FloodInfo, Location, Webservice 9 | from overstroomik_service.config import settings 10 | from overstroomik_service.errors import Errors 11 | from overstroomik_service.geoserver import Geoserver 12 | from overstroomik_service.pdok import PDOK 13 | 14 | app = FastAPI(openapi_url=settings.openapi_url) 15 | app.add_middleware( 16 | CORSMiddleware, 17 | allow_origins=settings.BACKEND_CORS_ORIGINS, 18 | allow_methods=["*"], 19 | allow_headers=["*"], 20 | ) 21 | 22 | 23 | @app.get("/") 24 | async def read_root(): 25 | return Webservice( 26 | version=settings.WS_VERSION, 27 | status=Errors.ERROR_GENERAL_IMEP.value["status"], 28 | errorcode=Errors.ERROR_GENERAL_IMEP.value["errorcode"] 29 | ) 30 | 31 | 32 | @app.get("/by_rd", response_model=FloodInfo) 33 | async def by_rd(x: float, y: float) -> FloodInfo: 34 | 35 | # Get location information from the geoserver 36 | status, data = await Geoserver.get_data(x, y) 37 | 38 | # Return location details 39 | return FloodInfo( 40 | webservice=Webservice( 41 | version=settings.WS_VERSION, 42 | status=status.value["status"], 43 | errorcode=status.value["errorcode"]), 44 | location=Location(rd_x=x, rd_y=y), 45 | data=data, 46 | ) 47 | 48 | 49 | @app.get("/by_location", response_model=FloodInfo) 50 | async def by_location( 51 | search_field: Optional[str] = None, 52 | latitude: Optional[float] = None, 53 | longitude: Optional[float] = None, 54 | ) -> FloodInfo: 55 | 56 | # Create pdok instance. 57 | pdok = PDOK() 58 | 59 | # determine which pdok function by input 60 | if search_field is not None and len(search_field.strip()) > 0: 61 | # Get address information from the PDOK services by search field 62 | status, location = await pdok.address_by_search_field(search_field) 63 | elif latitude and longitude: 64 | # Get address information from the PDOK services by latitude/ longitude 65 | status, location = await pdok.address_by_latlon(latitude, longitude) 66 | else: 67 | # No valid input for search_field or latitude and longitude 68 | raise HTTPException(status_code=422, detail=Errors.ERROR_BY_LOCATION_422.value["status"]) 69 | 70 | data = Data() 71 | 72 | if status == Errors.ERROR_GENERAL_NOER: 73 | # Get location information from the geoserver 74 | status, data = await Geoserver.get_data(location.rd_x, location.rd_y) 75 | 76 | # Return location details 77 | return FloodInfo( 78 | webservice=Webservice( 79 | version=settings.WS_VERSION, 80 | status=status.value["status"], 81 | errorcode=status.value["errorcode"]), 82 | location=location, 83 | data=data, 84 | ) 85 | 86 | 87 | if __name__ == "__main__": 88 | uvicorn.run(app, host="0.0.0.0", port=settings.PORT) 89 | -------------------------------------------------------------------------------- /backend/CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | .. highlight:: shell 2 | 3 | ============ 4 | Contributing 5 | ============ 6 | 7 | Contributions are welcome, and they are greatly appreciated! Every little bit 8 | helps, and credit will always be given. 9 | 10 | You can contribute in many ways: 11 | 12 | Types of Contributions 13 | ---------------------- 14 | 15 | Report Bugs 16 | ~~~~~~~~~~~ 17 | 18 | Report bugs at https://github.com/evetion/overstroomik_service/issues. 19 | 20 | If you are reporting a bug, please include: 21 | 22 | * Your operating system name and version. 23 | * Any details about your local setup that might be helpful in troubleshooting. 24 | * Detailed steps to reproduce the bug. 25 | 26 | Fix Bugs 27 | ~~~~~~~~ 28 | 29 | Look through the GitHub issues for bugs. Anything tagged with "bug" and "help 30 | wanted" is open to whoever wants to implement it. 31 | 32 | Implement Features 33 | ~~~~~~~~~~~~~~~~~~ 34 | 35 | Look through the GitHub issues for features. Anything tagged with "enhancement" 36 | and "help wanted" is open to whoever wants to implement it. 37 | 38 | Write Documentation 39 | ~~~~~~~~~~~~~~~~~~~ 40 | 41 | overstroomik-service could always use more documentation, whether as part of the 42 | official overstroomik-service docs, in docstrings, or even on the web in blog posts, 43 | articles, and such. 44 | 45 | Submit Feedback 46 | ~~~~~~~~~~~~~~~ 47 | 48 | The best way to send feedback is to file an issue at https://github.com/evetion/overstroomik_service/issues. 49 | 50 | If you are proposing a feature: 51 | 52 | * Explain in detail how it would work. 53 | * Keep the scope as narrow as possible, to make it easier to implement. 54 | * Remember that this is a volunteer-driven project, and that contributions 55 | are welcome :) 56 | 57 | Get Started! 58 | ------------ 59 | 60 | Ready to contribute? Here's how to set up `overstroomik_service` for local development. 61 | 62 | 1. Fork the `overstroomik_service` repo on GitHub. 63 | 2. Clone your fork locally:: 64 | 65 | $ git clone git@github.com:your_name_here/overstroomik_service.git 66 | 67 | 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:: 68 | 69 | $ mkvirtualenv overstroomik_service 70 | $ cd overstroomik_service/ 71 | $ python setup.py develop 72 | 73 | 4. Create a branch for local development:: 74 | 75 | $ git checkout -b name-of-your-bugfix-or-feature 76 | 77 | Now you can make your changes locally. 78 | 79 | 5. When you're done making changes, check that your changes pass flake8 and the 80 | tests, including testing other Python versions with tox:: 81 | 82 | $ flake8 overstroomik_service tests 83 | $ python setup.py test or pytest 84 | $ tox 85 | 86 | To get flake8 and tox, just pip install them into your virtualenv. 87 | 88 | 6. Commit your changes and push your branch to GitHub:: 89 | 90 | $ git add . 91 | $ git commit -m "Your detailed description of your changes." 92 | $ git push origin name-of-your-bugfix-or-feature 93 | 94 | 7. Submit a pull request through the GitHub website. 95 | 96 | Pull Request Guidelines 97 | ----------------------- 98 | 99 | Before you submit a pull request, check that it meets these guidelines: 100 | 101 | 1. The pull request should include tests. 102 | 2. If the pull request adds functionality, the docs should be updated. Put 103 | your new functionality into a function with a docstring, and add the 104 | feature to the list in README.rst. 105 | 3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check 106 | https://travis-ci.com/evetion/overstroomik_service/pull_requests 107 | and make sure that the tests pass for all supported Python versions. 108 | 109 | Tips 110 | ---- 111 | 112 | To run a subset of tests:: 113 | 114 | $ pytest tests.test_overstroomik_service 115 | 116 | 117 | Deploying 118 | --------- 119 | 120 | A reminder for the maintainers on how to deploy. 121 | Make sure all your changes are committed (including an entry in HISTORY.rst). 122 | Then run:: 123 | 124 | $ bump2version patch # possible: major / minor / patch 125 | $ git push 126 | $ git push --tags 127 | 128 | Travis will then deploy to PyPI if tests pass. 129 | -------------------------------------------------------------------------------- /helm/README.md: -------------------------------------------------------------------------------- 1 | # Overstroomik helm-chart 2 | 3 | Here you find the helm chart to install overstroomik webservice and geoserver in a kubernetes cluster. 4 | 5 | ## Installation 6 | 7 | You need [helm3](https://helm.sh/docs/intro/install/) to install this chart. To install overstroom run the following command. 8 | 9 | helm install 10 | 11 | ## Configuration 12 | 13 | You can configure the installation by adjusting the values.yaml or by providing your own configuration. All values missing in your own configuration file will be used from the default values.yaml. The --values option in the helm install command can be used to provide your own configuration file: 14 | 15 | helm install --values 16 | 17 | ### configartion options 18 | 19 | The following options are available in the values.yaml 20 | 21 | - replicacount on top of the values specifies the number of pods for bot backend and geoserver if autoscaling is not enabled 22 | - Use the images section to specify the docker image for backend and geoserver. 23 | - In the geoserver section autoscaling can be enabled based on either CPU or Memory usage 24 | - In the backend section autoscaling can be enabled based on either CPU or Memory usage. Also two environment variables are required for the backend. Note that the GEOSERVER_URL should match the name of geoserver deploymend. In the next example "overstroomik-geoserver" in GEOSERVER_URL refers to the geoserver name. 25 | 26 | 27 | geoserver: 28 | name: "overstroomik-geoserver" 29 | backend: 30 | environment_variables: 31 | GEOSERVER_URL: http://overstroomik-geoserver:8080/geoserver 32 | 33 | - In the ingress section a name should be provided. This name is visible in the kubernetes cluster. The host is specifies the url of the application and in services sections ingress for both Geoserver and Backend is defined. Note that the names of these services refer to the names defined in the geoserver and backend section. These should match. 34 | 35 | ## Deployment 36 | 37 | Installing this chart will give you the following installation in the kubernetes cluster: 38 | 39 | - Geoserver deployment 40 | - Backend deployment 41 | - Geoserver service 42 | - Backend service 43 | - Geoserver Horizontal Pod Autoscaler (if enabled in values.yaml) 44 | - Backend Horizontal Pod Autoscaler (if enabled in values.yaml) 45 | - ingress for both Geoserver and Backend 46 | 47 | Check deployment, Conto 48 | 49 | kubectl get pods 50 | 51 | Check service: 52 | 53 | kubectl get service 54 | 55 | Check Horizontal Pod Autoscaler 56 | 57 | kubectl get hpa 58 | 59 | Check ingress 60 | 61 | kubectl get ingress 62 | 63 | If ingress is correctly configured and deployment is succesful, the follwing urls should be available: 64 | 65 | - /by_location?latitude=52.017825&longitude=4.3359123 66 | 67 | example output: 68 | 69 | { 70 | "webservice": { 71 | "status": "No error", 72 | "version": "1.0.0" 73 | }, 74 | "location": { 75 | "search_field": null, 76 | "latitude": 52.01759004, 77 | "longitude": 4.33613331, 78 | "rd_x": 82851.006, 79 | "rd_y": 448214.677, 80 | "address": "Haantje", 81 | "municipality": "Rijswijk", 82 | "zipcode": "2288CX" 83 | }, 84 | "data": { 85 | "flood_type": "binnen dijkring, mogelijk overstroombaar", 86 | "maximum_water_depth": 0.0, 87 | "probability_of_flooding": "middelgrote kans: 1/30 tot 1/300 per jaar", 88 | "evacuation_percentage": 12.0, 89 | "safety_board_id": 15 90 | } 91 | } 92 | 93 | 94 | Webservice.status = "No error" is the important output to look at. 95 | 96 | - /geoserver/overstroomik/wms?service=WMS&version=1.1.0&request=GetMap&layers=overstroomik%3Aadministratieve_grenzen_veiligheidsregios&bbox=634.5732789819012%2C306594.5543000576%2C284300.0254094796%2C636981.7698870874&width=659&height=768&srs=EPSG%3A28992&styles=&format=image%2Fpng 97 | 98 | This should respond with an image of the Netherlands. 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /backend/overstroomik_service/auto_models.py: -------------------------------------------------------------------------------- 1 | # generated by datamodel-codegen: 2 | # filename: openapi.yaml 3 | # timestamp: 2020-10-30T07:47:22+00:00 4 | 5 | from __future__ import annotations 6 | 7 | from enum import Enum 8 | from typing import Optional 9 | 10 | from pydantic import BaseModel, Field, confloat, constr 11 | 12 | 13 | class Webservice(BaseModel): 14 | errorcode: Optional[float] = Field(None, example=0) 15 | status: Optional[str] = Field(None, example="no-error") 16 | version: Optional[str] = Field(None, example="overstroomik webservice 1.0.0") 17 | 18 | 19 | class Location(BaseModel): 20 | search_field: Optional[str] = Field( 21 | None, description="content of original search field\n", example="8232JN" 22 | ) 23 | latitude: Optional[confloat(ge=-90.0, le=90.0)] = Field( 24 | None, description="geocoded location\n", example=52.5066973961792 25 | ) 26 | longitude: Optional[confloat(ge=0.0, le=360.0)] = Field( 27 | None, description="geocoded location longitude\n", example=5.46887674785145 28 | ) 29 | rd_x: Optional[float] = Field( 30 | None, 31 | description="x coordinate in meters, geocoded location longitude transformed into EPSG:28992 \n", 32 | example=160544.902, 33 | ) 34 | rd_y: Optional[float] = Field( 35 | None, 36 | description="y coordinate in meters, geocoded location latitude transformed into EPSG:28992\n", 37 | example=502115.495, 38 | ) 39 | address: Optional[str] = Field( 40 | None, description="geocoded adress (street/house number)\n", example="Botter 11" 41 | ) 42 | municipality: Optional[str] = Field( 43 | None, description="geocoded adress (municipality)\n", example="Lelystad" 44 | ) 45 | zipcode: Optional[constr(regex="\d{4}[A-Z]{2}")] = Field( 46 | None, description="geocoded zipcode \n", example="8232JN" 47 | ) 48 | 49 | 50 | class FloodType(Enum): 51 | binnen_dijkring__mogelijk_overstroombaar = ( 52 | "binnen dijkring, mogelijk overstroombaar" 53 | ) 54 | buiten_dijkring__geen_hogegrond__buitendijks_of_buiten_water_ = ( 55 | "buiten dijkring, geen hogegrond (buitendijks of buiten water)" 56 | ) 57 | buiten_dijkring__hogegrond = "buiten dijkring, hogegrond" 58 | 59 | 60 | class ProbabilityOfFlooding(Enum): 61 | geen_significante_overstromingskans = "geen significante overstromingskans" 62 | grote_kans____1_30_per_jaar = "grote kans: > 1/30 per jaar" 63 | middelgrote_kans__1_30_tot_1_300_per_jaar = ( 64 | "middelgrote kans: 1/30 tot 1/300 per jaar" 65 | ) 66 | kleine_kans__1_300_tot_1_3_000_per_jaar = "kleine kans: 1/300 tot 1/3.000 per jaar" 67 | zeer_kleine_kans__1_3_000_tot_1_30_000_per_jaar = ( 68 | "zeer kleine kans: 1/3.000 tot 1/30.000 per jaar" 69 | ) 70 | extreem_kleine_kans____1_30_000_per_jaar = ( 71 | "extreem kleine kans: < 1/30.000 per jaar" 72 | ) 73 | 74 | 75 | class Data(BaseModel): 76 | flood_type: Optional[FloodType] = Field( 77 | None, 78 | description="type of flooding area\n", 79 | example="binnen dijkring, mogelijk overstroombaar", 80 | ) 81 | maximum_water_depth: Optional[confloat(ge=0.0)] = Field( 82 | None, description="maximum water depth in meters\n", example=3.2242 83 | ) 84 | probability_of_flooding: Optional[ProbabilityOfFlooding] = Field( 85 | None, 86 | description="expected frequency per year for flooding\n", 87 | example="kleine kans: 1/300 tot 1/3.000 per jaar", 88 | ) 89 | evacuation_percentage: Optional[confloat(ge=0.0, le=100.0)] = Field( 90 | None, 91 | description="expected evacuation percentage\nif percentage ≤ 20 then ‘vrijwel niemand kan het gebied verlaten’\nif percentage ≤ 40 then ‘een klein deel kan het gebied verlaten’\nif percentage ≤ 60 then ‘ongeveer de helft kan het gebied verlaten’\nif percentage ≤ 80 then ‘een groot deel kan het gebied verlaten’\nif percentage > 80 then ‘vrijwel iedereen kan het gebied verlaten’\n", 92 | example=35, 93 | ) 94 | safety_board_id: Optional[int] = Field( 95 | None, description="unique id of safety board\n", example=12 96 | ) 97 | 98 | 99 | class FloodInfo(BaseModel): 100 | webservice: Webservice 101 | location: Location 102 | data: Data 103 | -------------------------------------------------------------------------------- /backend/tests/test_pdok.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import asyncio 3 | from overstroomik_service.errors import Errors 4 | from overstroomik_service.pdok import PDOK 5 | import warnings 6 | 7 | 8 | @pytest.mark.asyncio 9 | async def test_address_by_search_field_zip_code() -> None: 10 | pdok = PDOK() 11 | status, location = await pdok.address_by_search_field(search_field="8232JN") 12 | 13 | assert status == Errors.ERROR_GENERAL_NOER 14 | assert location.latitude == 52.50669969 15 | assert location.longitude == 5.46887425 #5.46887432 16 | assert location.rd_x == 160544.902 17 | assert location.rd_y == 502115.495 18 | assert location.search_field == "8232JN" 19 | assert location.address == "Botter 11" 20 | assert location.municipality == "Lelystad" 21 | assert location.zipcode == "8232JN" 22 | 23 | 24 | @pytest.mark.asyncio 25 | async def test_address_by_latlon() -> None: 26 | pdok = PDOK() 27 | status, location = await pdok.address_by_latlon( 28 | latitude=52.50669969, longitude=5.46887432 29 | ) 30 | 31 | assert status == Errors.ERROR_GENERAL_NOER 32 | assert location.latitude == 52.50669597 33 | assert location.longitude == 5.46888289 34 | assert location.rd_x == 160545.489 35 | assert location.rd_y == 502115.081 36 | assert location.search_field is None 37 | assert location.address == "Botter 11" 38 | assert location.municipality == "Lelystad" 39 | assert location.zipcode == "8232JN" 40 | 41 | 42 | @pytest.mark.asyncio 43 | async def test_fetch_data() -> None: 44 | pdok = PDOK() 45 | 46 | url = "https://api.pdok.nl/bzk/locatieserver/search/v3_1/free" 47 | 48 | fields = "centroide_rd,centroide_ll,straatnaam,woonplaatsnaam,postcode" 49 | 50 | latitude = 52.50669969 51 | longitude = 5.46887432 52 | 53 | params = { 54 | "q": "type:adres", 55 | "lat": latitude, 56 | "lon": longitude, 57 | "rows": 1, 58 | "fl": fields, 59 | } 60 | 61 | status, adress_item = await pdok.fetch_data(url=url, params=params) 62 | 63 | assert status == Errors.ERROR_GENERAL_NOER 64 | assert adress_item.get("latitude", 0) == 52.50669597 65 | assert adress_item.get("longitude", 0) == 5.46888289 #5.46888296 66 | assert adress_item.get("address", "") == "Botter 11" 67 | assert adress_item.get("municipality", "") == "Lelystad" 68 | assert adress_item.get("zipcode", "") == "8232JN" 69 | 70 | 71 | def test_list_to_location() -> None: 72 | 73 | pdok_result = { 74 | "response": { 75 | "numFound": 9395778, 76 | "start": 0, 77 | "maxScore": 0.17737934, 78 | "docs": [ 79 | { 80 | "woonplaatsnaam": "Lelystad", 81 | "postcode": "8232JN", 82 | "centroide_ll": "POINT(5.46888296 52.50669597)", 83 | "centroide_rd": "POINT(160545.489 502115.081)", 84 | "straatnaam": "Botter 11", 85 | } 86 | ], 87 | } 88 | } 89 | 90 | pdok = PDOK() 91 | status, adress_item = pdok.list_to_location(out=pdok_result) 92 | 93 | assert status == Errors.ERROR_GENERAL_NOER 94 | assert adress_item.get("latitude", 0) == 52.50669597 95 | assert adress_item.get("longitude", 0) == 5.46888296 96 | assert adress_item.get("rd_x", 0) == 160545.489 97 | assert adress_item.get("rd_y", 0) == 502115.081 98 | assert adress_item.get("address", "") == "Botter 11" 99 | assert adress_item.get("municipality", "") == "Lelystad" 100 | assert adress_item.get("zipcode", "") == "8232JN" 101 | 102 | 103 | def test_to_location() -> None: 104 | 105 | doc_item = { 106 | "woonplaatsnaam": "Lelystad", 107 | "postcode": "8232JN", 108 | "centroide_ll": "POINT(5.46888296 52.50669597)", 109 | "centroide_rd": "POINT(160545.489 502115.081)", 110 | "straatnaam": "Botter 11", 111 | } 112 | 113 | pdok = PDOK() 114 | adress_item = pdok.to_location(doc_item=doc_item) 115 | 116 | assert adress_item.get("latitude", 0) == 52.50669597 117 | assert adress_item.get("longitude", 0) == 5.46888296 118 | assert adress_item.get("rd_x", 0) == 160545.489 119 | assert adress_item.get("rd_y", 0) == 502115.081 120 | assert adress_item.get("address", "") == "Botter 11" 121 | assert adress_item.get("municipality", "") == "Lelystad" 122 | assert adress_item.get("zipcode", "") == "8232JN" 123 | -------------------------------------------------------------------------------- /backend/overstroomik_service/pdok.py: -------------------------------------------------------------------------------- 1 | """ 2 | This class uses the pdok-api to find address information 3 | 4 | """ 5 | import logging 6 | 7 | import httpx 8 | 9 | from overstroomik_service.auto_models import Location 10 | from overstroomik_service.config import settings 11 | from overstroomik_service.errors import Errors 12 | 13 | 14 | class PDOK: 15 | 16 | # pdok api url 17 | api = "https://api.pdok.nl/bzk/locatieserver/search/v3_1/free" 18 | 19 | # fields we need 20 | fields = "centroide_rd,centroide_ll,straatnaam,woonplaatsnaam,postcode" 21 | 22 | async def address_by_search_field(self, search_field: str): 23 | """ 24 | Search address information with specified search string. 25 | :param search_field: content of original search field 26 | """ 27 | # input parameters for pdok-api 28 | params = {"q": search_field, "rows": 1, "fl": self.fields} 29 | 30 | # fetch date and return address 31 | status, address_item = await self.fetch_data(url=self.api, params=params) 32 | 33 | address_item["search_field"] = search_field 34 | 35 | return status, Location(**address_item) 36 | 37 | async def address_by_latlon(self, latitude: float, longitude: float): 38 | """ 39 | Search address information with specified latitude and longitude. 40 | :param latitude: coordinate in degrees in EPSG:4326 41 | :param longitude: coordinate in degrees in EPSG:4326 42 | """ 43 | 44 | # input parameters for pdok-api 45 | params = { 46 | "q": "type:adres", 47 | "lat": latitude, 48 | "lon": longitude, 49 | "rows": 1, 50 | "fl": self.fields, 51 | } 52 | 53 | # fetch date and return address 54 | status, address_item = await self.fetch_data(url=self.api, params=params) 55 | 56 | return status, Location(**address_item) 57 | 58 | async def fetch_data(self, url: str, params: dict): 59 | """ 60 | Get the data from PDOK 61 | :param url: api url to fetch 62 | """ 63 | address_item = {} 64 | 65 | # connect async to the pdok-api 66 | async with httpx.AsyncClient() as client: 67 | 68 | # fetch the feature info 69 | try: 70 | result = await client.get( 71 | url=url, params=params, timeout=settings.FETCH_TIMEOUT 72 | ) 73 | if result.status_code == httpx.codes.OK: 74 | status, address_item = self.list_to_location(result.json()) 75 | else: 76 | status = Errors.ERROR_PDOK_NO_RESP 77 | 78 | except httpx.RequestError as exc: 79 | logging.exception( 80 | f"Failed to connect to PDOK using {exc.request.url!r}" 81 | ) 82 | status = Errors.ERROR_PDOK_NO_RESP 83 | 84 | # return status and address information 85 | return status, address_item 86 | 87 | def list_to_location(self, out: dict): 88 | """ 89 | Get the best result from de pdok list (now just 1 item). 90 | Later we can get more than 1 item and decide which we use as best result. 91 | :param out: array with multiple address-items from pdok 92 | """ 93 | # initial no error 94 | status = Errors.ERROR_GENERAL_NOER 95 | 96 | address_item = {} 97 | response = out.get("response", {}) 98 | 99 | if response.get("numFound", 0) > 0: 100 | docs = response.get("docs") 101 | if len(docs) > 0: 102 | # Use the first result, this one has the highest score. 103 | address_item = self.to_location(docs[0]) 104 | else: 105 | status = Errors.ERROR_PDOK_NO_RESU 106 | else: 107 | status = Errors.ERROR_PDOK_NO_RESU 108 | 109 | return status, address_item 110 | 111 | def to_location(self, doc_item: dict): 112 | """ 113 | Translate pdok-item to location item 114 | :param doc_item: single pdok address 115 | """ 116 | 117 | rd = ( 118 | doc_item.get("centroide_rd", "0 0") 119 | .replace("POINT(", "") 120 | .replace(")", "") 121 | .split(" ") 122 | ) 123 | ll = ( 124 | doc_item.get("centroide_ll", "0 0") 125 | .replace("POINT(", "") 126 | .replace(")", "") 127 | .split(" ") 128 | ) 129 | 130 | return { 131 | "latitude": float(ll[1]), 132 | "longitude": float(ll[0]), 133 | "rd_x": float(rd[0]), 134 | "rd_y": float(rd[1]), 135 | "address": doc_item.get("straatnaam", None), 136 | "municipality": doc_item.get("woonplaatsnaam", None), 137 | "zipcode": doc_item.get("postcode", None), 138 | } 139 | -------------------------------------------------------------------------------- /backend/tests/test_geoserver.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from overstroomik_service.auto_models import FloodType, ProbabilityOfFlooding, Data 4 | from overstroomik_service.errors import Errors 5 | from overstroomik_service.geoserver import Geoserver 6 | from overstroomik_service.config import settings 7 | 8 | 9 | def test_data(): 10 | """Test monkey patched validators.""" 11 | d = Data(maximum_water_depth=100, probability_of_flooding="test", flood_type="test") 12 | assert d.maximum_water_depth == 0.0 13 | assert d.probability_of_flooding is None 14 | assert d.flood_type is None 15 | 16 | 17 | @pytest.mark.skipif( 18 | (not settings.COMPOSE), 19 | reason="requires geoserver with docker-compose (see COMPOSE env)", 20 | ) 21 | @pytest.mark.asyncio 22 | async def test_get_data() -> None: 23 | """ 24 | Test a valid situation with expected values 25 | """ 26 | 27 | status, data = await Geoserver.get_data( 28 | rd_x=158492.416, rd_y=502424.151, geoserver_url=settings.GEOSERVER_URL, 29 | ) 30 | 31 | assert status == Errors.ERROR_GENERAL_NOER 32 | assert data.flood_type == FloodType.binnen_dijkring__mogelijk_overstroombaar 33 | assert ( 34 | data.probability_of_flooding 35 | == ProbabilityOfFlooding.kleine_kans__1_300_tot_1_3_000_per_jaar 36 | ) 37 | assert data.maximum_water_depth == 2.0899999141693115 38 | assert data.evacuation_percentage == 55 39 | assert data.safety_board_id == 25 40 | 41 | 42 | @pytest.mark.asyncio 43 | async def test_out_of_bounds() -> None: 44 | """ 45 | Test a valid situation with expected values 46 | """ 47 | 48 | status, data = await Geoserver.get_data( 49 | rd_x=158492.416, rd_y=0, geoserver_url=settings.GEOSERVER_URL, 50 | ) 51 | 52 | assert status == Errors.ERROR_OUT_OF_BOUND 53 | 54 | 55 | @pytest.mark.skipif( 56 | (not settings.COMPOSE), 57 | reason="requires geoserver with docker-compose (see COMPOSE env)", 58 | ) 59 | @pytest.mark.asyncio 60 | async def test_get_data_validator_waterdepth() -> None: 61 | """ 62 | Test a valid situation with expected values 63 | Given rd coordinates is in Harderwijk en returns -9999 from the layer 64 | The validator limited to 0.0 65 | """ 66 | 67 | status, data = await Geoserver.get_data( 68 | rd_x=172510, rd_y=483742, geoserver_url=settings.GEOSERVER_URL, 69 | ) 70 | 71 | assert status == Errors.ERROR_GENERAL_NOER 72 | assert data.maximum_water_depth == 0.0 73 | 74 | 75 | @pytest.mark.skipif( 76 | (not settings.COMPOSE), 77 | reason="requires geoserver with docker-compose (see COMPOSE env)", 78 | ) 79 | @pytest.mark.asyncio 80 | async def test_get_data_validator_enum() -> None: 81 | """ 82 | Test a enums with expected values 83 | """ 84 | 85 | status, data = await Geoserver.get_data( 86 | rd_x=158492.416, rd_y=502424.151, geoserver_url=settings.GEOSERVER_URL, 87 | ) 88 | 89 | assert status == Errors.ERROR_GENERAL_NOER 90 | assert ( 91 | data.probability_of_flooding 92 | == ProbabilityOfFlooding.kleine_kans__1_300_tot_1_3_000_per_jaar 93 | ) 94 | assert data.flood_type == FloodType.binnen_dijkring__mogelijk_overstroombaar 95 | 96 | 97 | @pytest.mark.asyncio 98 | async def test_no_service() -> None: 99 | """ 100 | Test when the geoserver in unavailable 101 | """ 102 | status, data = await Geoserver.get_data( 103 | rd_x=158492.416, 104 | rd_y=502424.151, 105 | geoserver_url=f"http://non-existent:8080/geoserver", 106 | ) 107 | 108 | assert status == Errors.ERROR_GEOS_NO_RESP 109 | 110 | 111 | @pytest.mark.skipif( 112 | (not settings.COMPOSE), 113 | reason="requires geoserver with docker-compose (see COMPOSE env)", 114 | ) 115 | def test_get_api_url_from_rd() -> None: 116 | """ 117 | Test the creation of the api url, it return also the width, height, x and x. 118 | Input rd_x and rd_y is different 119 | """ 120 | 121 | # test 1 122 | # Given the x and y, this must result a valid coordinate with the specific values 123 | url, params, coordinate_is_valid, indices = Geoserver.get_api_url_from_rd( 124 | rd_x=158492.416, rd_y=502424.151, geoserver_url=settings.GEOSERVER_URL, 125 | ) 126 | 127 | assert settings.GEOSERVER_URL in url 128 | assert indices[2] == 157858.416 129 | assert indices[3] == 134556.849 130 | assert indices[0] == 283666.0 131 | assert indices[1] == 330387.0 132 | assert coordinate_is_valid is True 133 | 134 | # test 2 135 | # Given the x and y, this must result a invalid coordinate with no values 136 | # The input is outside the grouplayers extend 137 | url, params, coordinate_is_valid, indices = Geoserver.get_api_url_from_rd( 138 | rd_x=633, rd_y=636982, geoserver_url=settings.GEOSERVER_URL 139 | ) 140 | 141 | assert settings.GEOSERVER_URL in url 142 | assert indices[2] == -1 143 | assert indices[3] == -1 144 | assert coordinate_is_valid is False 145 | 146 | # test 3 147 | # Given the x and y, this must result a invalid coordinate with no values 148 | # The input is outside the grouplayers extend 149 | url, params, coordinate_is_valid, indices = Geoserver.get_api_url_from_rd( 150 | rd_x=284301, rd_y=306594, geoserver_url=settings.GEOSERVER_URL, 151 | ) 152 | 153 | assert settings.GEOSERVER_URL in url 154 | assert indices[2] == 284301 - 634 155 | assert indices[3] == 636981 - 306594 156 | assert coordinate_is_valid is False 157 | -------------------------------------------------------------------------------- /backend/docs/conf.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # overstroomik_service documentation build configuration file, created by 4 | # sphinx-quickstart on Fri Jun 9 13:47:02 2017. 5 | # 6 | # This file is execfile()d with the current directory set to its 7 | # containing dir. 8 | # 9 | # Note that not all possible configuration values are present in this 10 | # autogenerated file. 11 | # 12 | # All configuration values have a default; values that are commented out 13 | # serve to show the default. 14 | 15 | # If extensions (or modules to document with autodoc) are in another 16 | # directory, add these directories to sys.path here. If the directory is 17 | # relative to the documentation root, use os.path.abspath to make it 18 | # absolute, like shown here. 19 | # 20 | import os 21 | import sys 22 | 23 | sys.path.insert(0, os.path.abspath("..")) 24 | 25 | import overstroomik_service 26 | 27 | # -- General configuration --------------------------------------------- 28 | 29 | # If your documentation needs a minimal Sphinx version, state it here. 30 | # 31 | # needs_sphinx = '1.0' 32 | 33 | # Add any Sphinx extension module names here, as strings. They can be 34 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 35 | extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"] 36 | 37 | # Add any paths that contain templates here, relative to this directory. 38 | templates_path = ["_templates"] 39 | 40 | # The suffix(es) of source filenames. 41 | # You can specify multiple suffix as a list of string: 42 | # 43 | # source_suffix = ['.rst', '.md'] 44 | source_suffix = ".rst" 45 | 46 | # The master toctree document. 47 | master_doc = "index" 48 | 49 | # General information about the project. 50 | project = "overstroomik-service" 51 | copyright = "2020, Maarten Pronk" 52 | author = "Maarten Pronk" 53 | 54 | # The version info for the project you're documenting, acts as replacement 55 | # for |version| and |release|, also used in various other places throughout 56 | # the built documents. 57 | # 58 | # The short X.Y version. 59 | version = overstroomik_service.__version__ 60 | # The full version, including alpha/beta/rc tags. 61 | release = overstroomik_service.__version__ 62 | 63 | # The language for content autogenerated by Sphinx. Refer to documentation 64 | # for a list of supported languages. 65 | # 66 | # This is also used if you do content translation via gettext catalogs. 67 | # Usually you set "language" from the command line for these cases. 68 | language = None 69 | 70 | # List of patterns, relative to source directory, that match files and 71 | # directories to ignore when looking for source files. 72 | # This patterns also effect to html_static_path and html_extra_path 73 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] 74 | 75 | # The name of the Pygments (syntax highlighting) style to use. 76 | pygments_style = "sphinx" 77 | 78 | # If true, `todo` and `todoList` produce output, else they produce nothing. 79 | todo_include_todos = False 80 | 81 | 82 | # -- Options for HTML output ------------------------------------------- 83 | 84 | # The theme to use for HTML and HTML Help pages. See the documentation for 85 | # a list of builtin themes. 86 | # 87 | html_theme = "alabaster" 88 | 89 | # Theme options are theme-specific and customize the look and feel of a 90 | # theme further. For a list of options available for each theme, see the 91 | # documentation. 92 | # 93 | # html_theme_options = {} 94 | 95 | # Add any paths that contain custom static files (such as style sheets) here, 96 | # relative to this directory. They are copied after the builtin static files, 97 | # so a file named "default.css" will overwrite the builtin "default.css". 98 | html_static_path = ["_static"] 99 | 100 | 101 | # -- Options for HTMLHelp output --------------------------------------- 102 | 103 | # Output file base name for HTML help builder. 104 | htmlhelp_basename = "overstroomik_servicedoc" 105 | 106 | 107 | # -- Options for LaTeX output ------------------------------------------ 108 | 109 | latex_elements = { 110 | # The paper size ('letterpaper' or 'a4paper'). 111 | # 112 | # 'papersize': 'letterpaper', 113 | # The font size ('10pt', '11pt' or '12pt'). 114 | # 115 | # 'pointsize': '10pt', 116 | # Additional stuff for the LaTeX preamble. 117 | # 118 | # 'preamble': '', 119 | # Latex figure (float) alignment 120 | # 121 | # 'figure_align': 'htbp', 122 | } 123 | 124 | # Grouping the document tree into LaTeX files. List of tuples 125 | # (source start file, target name, title, author, documentclass 126 | # [howto, manual, or own class]). 127 | latex_documents = [ 128 | ( 129 | master_doc, 130 | "overstroomik_service.tex", 131 | "overstroomik-service Documentation", 132 | "Maarten Pronk", 133 | "manual", 134 | ), 135 | ] 136 | 137 | 138 | # -- Options for manual page output ------------------------------------ 139 | 140 | # One entry per manual page. List of tuples 141 | # (source start file, name, description, authors, manual section). 142 | man_pages = [ 143 | ( 144 | master_doc, 145 | "overstroomik_service", 146 | "overstroomik-service Documentation", 147 | [author], 148 | 1, 149 | ) 150 | ] 151 | 152 | 153 | # -- Options for Texinfo output ---------------------------------------- 154 | 155 | # Grouping the document tree into Texinfo files. List of tuples 156 | # (source start file, target name, title, author, 157 | # dir menu entry, description, category) 158 | texinfo_documents = [ 159 | ( 160 | master_doc, 161 | "overstroomik_service", 162 | "overstroomik-service Documentation", 163 | author, 164 | "overstroomik_service", 165 | "One line description of project.", 166 | "Miscellaneous", 167 | ), 168 | ] 169 | -------------------------------------------------------------------------------- /backend/overstroomik_service/geoserver.py: -------------------------------------------------------------------------------- 1 | """ 2 | This class uses the geoserver-api and geoserver layers to find 3 | location information by rd coordinates 4 | """ 5 | 6 | import logging 7 | from typing import Optional 8 | 9 | import httpx 10 | import sys 11 | 12 | from overstroomik_service.auto_models import Data 13 | from overstroomik_service.config import settings 14 | from overstroomik_service.errors import Errors 15 | 16 | 17 | class Geoserver: 18 | @staticmethod 19 | async def get_data( 20 | rd_x: float, 21 | rd_y: float, 22 | geoserver_url: str = settings.GEOSERVER_URL, 23 | layers: str = settings.GEOSERVER_LAYER, 24 | ): 25 | """ 26 | Find location information with specified rd coordinates. 27 | :param rd_x: x coordinate in meters, geocoded location longitude transformed into EPSG:28992 28 | :param rd_y: y coordinate in meters, geocoded location latitude transformed into EPSG:28992 29 | :param geoserver_url: link to the geoserver (example: http://geoserver:8080/geoserver) 30 | :param layers: group layer with the expected data (example: overstroomik:Overstroomik_data) 31 | """ 32 | 33 | # initial no error 34 | status = Errors.ERROR_GENERAL_NOER 35 | 36 | # start with empty object 37 | data = Data() 38 | 39 | # create the getfeature info url 40 | url, params, coordinate_is_valid, indices = Geoserver.get_api_url_from_rd( 41 | rd_x=rd_x, rd_y=rd_y, geoserver_url=geoserver_url 42 | ) 43 | 44 | # Check input, is location between the layer exent 45 | if not coordinate_is_valid: 46 | status = Errors.ERROR_OUT_OF_BOUND 47 | else: 48 | # connect async to the geoserver 49 | async with httpx.AsyncClient() as client: 50 | 51 | # fetch the feature info 52 | try: 53 | result = await client.get( 54 | url=url, params=params, timeout=settings.FETCH_TIMEOUT 55 | ) 56 | if result.status_code == httpx.codes.OK: 57 | out = result.json() 58 | features = out.get("features") 59 | status, data = Geoserver.to_data(features) 60 | else: 61 | status = Errors.ERROR_GEOS_NO_RESP 62 | 63 | # except httpx.RequestError as exc: 64 | # logging.exception( 65 | # f"Failed to connect to geoserver using {exc.request.url!r}" 66 | # ) 67 | # status = Errors.ERROR_GEOS_NO_RESP 68 | 69 | except ValueError as vexc: 70 | logging.exception( 71 | f"Failed to parse result into json format" 72 | ) 73 | status = Errors.ERROR_GEOS_NO_SMAP 74 | 75 | except: 76 | e = sys.exc_info()[0] 77 | logging.exception( 78 | f"Failed to connect to geoserver or parse result: {e}" 79 | ) 80 | status = Errors.ERROR_GEOS_NO_RESP 81 | 82 | return status, data 83 | 84 | @staticmethod 85 | def to_data(features: dict): 86 | 87 | # start with empty object 88 | data = Data() 89 | 90 | # initial no error 91 | status = Errors.ERROR_GENERAL_NOER 92 | 93 | if len(features) > 0: 94 | 95 | data_item = {} 96 | 97 | for data_layer in settings.data_layers: 98 | property = data_layer["property"] 99 | layer = data_layer["layer"] 100 | field = data_layer["field"] 101 | 102 | data_item[property] = Geoserver.get_item( 103 | features=features, layer=layer, field=field 104 | ) 105 | 106 | data = Data(**data_item) 107 | else: 108 | status: Errors.ERROR_GEOS_NO_SMAP 109 | 110 | return status, data 111 | 112 | @staticmethod 113 | def get_item(features: dict, layer: str, field: str): 114 | 115 | value = None 116 | 117 | for feature in features: 118 | f_id = feature.get("id") 119 | properties = feature.get("properties") 120 | 121 | # the raster layer has no id in de json data (features), 122 | # so we have one layer with an empty string. When we need 123 | # more raster layers, the field (GRAY_INDEX) must 124 | # used and must be unique 125 | if layer == "" and f_id == "": 126 | value = properties.get(field, None) 127 | 128 | elif len(layer) > 0 and f_id.startswith(layer): 129 | value = properties.get(field, None) 130 | 131 | return value 132 | 133 | @staticmethod 134 | def get_api_url_from_rd( 135 | rd_x: float, 136 | rd_y: float, 137 | geoserver_url: Optional[str] = settings.GEOSERVER_URL, 138 | layers: [str] = settings.GEOSERVER_LAYER, 139 | ): 140 | """ 141 | Create the get-feature-info link. 142 | :param rd_x: x coordinate in meters, geocoded location longitude transformed into EPSG:28992 143 | :param rd_y: y coordinate in meters, geocoded location latitude transformed into EPSG:28992 144 | :param geoserver_url: link to the geoserver (example: http://geoserver:8080/geoserver) 145 | :param layers: group layer with the expected data (example: overstroomik:Overstroomik_data) 146 | 147 | The 'getfeatureinfo' of the geoserver requires a bbox+width+height+x+y, 148 | so we have to calculate the correct indices by ourselves, which is why 149 | this can be hardcoded. The x and y are integer coordinates in pixels 150 | """ 151 | 152 | # api url template 153 | url = f"{geoserver_url}/overstroomik/wms" 154 | 155 | # bounding box (extent of the group layer) 156 | min_x = settings.grouplayer_extent_rd["min_x"] 157 | min_y = settings.grouplayer_extent_rd["min_y"] 158 | max_x = settings.grouplayer_extent_rd["max_x"] 159 | max_y = settings.grouplayer_extent_rd["max_y"] 160 | 161 | # test the input coordinate is in layer-extend 162 | coordinate_is_valid = ( 163 | rd_x >= min_x and rd_x <= max_x and rd_y >= min_y and rd_y <= max_y 164 | ) 165 | 166 | # calculate the height and width 167 | height = max_y - min_y 168 | width = max_x - min_x 169 | 170 | # calculate x/y relative to the extent 171 | ddx = rd_x - min_x 172 | ddy = rd_y - min_y 173 | 174 | # calculate then x/y in pixels 175 | x = width * ddx / width 176 | y = height - (height * ddy / height) 177 | 178 | # bounding box format 179 | bounding_box = f"{min_x},{min_y},{max_x},{max_y}" 180 | 181 | indices = (width, height, x, y) 182 | 183 | params = { 184 | "SERVICE": "WMS", 185 | "VERSION": "1.1.1", 186 | "REQUEST": "GetFeatureInfo", 187 | "INFO_FORMAT": "application/json", 188 | "SRS": "EPSG:28992", 189 | "FEATURE_COUNT": "50", 190 | "LAYERS": layers, 191 | "QUERY_LAYERS": layers, 192 | "BBOX": bounding_box, 193 | "WIDTH": int(width), 194 | "HEIGHT": int(height), 195 | "X": int(x), 196 | "Y": int(y), 197 | } 198 | 199 | return url, params, coordinate_is_valid, indices 200 | -------------------------------------------------------------------------------- /backend/openapi.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.0 2 | info: 3 | title: Overstroomik 4 | description: The overstroomik.nl backend service. Used to get information about how flood prone a location is in the Netherlands 5 | contact: 6 | name: Fedor Baart 7 | email: fedor.baart@deltares.nl 8 | license: 9 | name: GPL 3.0 10 | url: http://www.gnu.org/licenses/gpl-3.0.en.html 11 | version: 1.0.0 12 | servers: 13 | - url: https://virtserver.swaggerhub.com/overstroomik/overstroomik.nl/1.0.0 14 | description: SwaggerHub API Auto Mocking 15 | - url: https://www.overstroomik.nl 16 | description: Production 17 | tags: 18 | - name: developers 19 | description: Operations available to regular developers 20 | paths: 21 | /by_rd: 22 | get: 23 | tags: 24 | - developers 25 | summary: query the overstroomik.nl service by geospatial coordinates in EPSG:28992 26 | description: | 27 | Query the overstroomik.nl service by coordinates (x,y) in Rijksdriehoekstelsel (EPSG:28992). Returns information about how flood prone the location is. 28 | operationId: by_rd 29 | parameters: 30 | - name: x 31 | in: query 32 | description: | 33 | x coordinate in EPSG:28992 in meters 34 | required: false 35 | style: form 36 | explode: true 37 | schema: 38 | type: number 39 | format: double 40 | example: 160544.902 41 | - name: "y" 42 | in: query 43 | description: | 44 | y coordinate in EPSG:28992 in meters 45 | required: false 46 | style: form 47 | explode: true 48 | schema: 49 | type: number 50 | format: double 51 | example: 502115.495 52 | responses: 53 | "200": 54 | description: Flooding information about the location 55 | content: 56 | application/json: 57 | schema: 58 | $ref: '#/components/schemas/FloodInfo' 59 | "400": 60 | description: bad input parameter 61 | /by_location: 62 | get: 63 | tags: 64 | - developers 65 | summary: query the overstroomik.nl service by location 66 | description: | 67 | Query the overstroomik.nl service by address, zipcode or latitude/longitude. Returns information about how flood prone the location is. 68 | operationId: by_location 69 | parameters: 70 | - name: search_field 71 | in: query 72 | description: | 73 | content of the search/address field. Can contain a zipcode or a street/city combination, or just a city. 74 | required: false 75 | style: form 76 | explode: true 77 | schema: 78 | type: string 79 | example: 8232JN 80 | - name: latitude 81 | in: query 82 | description: | 83 | GeolocationCoordinates.latitude of the browser in decimal degrees 84 | required: false 85 | style: form 86 | explode: true 87 | schema: 88 | maximum: 90 89 | minimum: -90 90 | type: number 91 | format: double 92 | example: 52.5066973961792 93 | - name: longitude 94 | in: query 95 | description: | 96 | GeolocationCoordinates.latitude of the browser in decimal degrees 97 | required: false 98 | style: form 99 | explode: true 100 | schema: 101 | maximum: 360 102 | minimum: -180 103 | type: number 104 | format: double 105 | example: 5.46887674785145 106 | responses: 107 | "200": 108 | description: Flooding information about the location 109 | content: 110 | application/json: 111 | schema: 112 | $ref: '#/components/schemas/FloodInfo' 113 | "400": 114 | description: bad input parameter 115 | components: 116 | schemas: 117 | FloodInfo: 118 | required: 119 | - data 120 | - location 121 | - webservice 122 | type: object 123 | properties: 124 | webservice: 125 | type: object 126 | properties: 127 | errorcode: 128 | type: number 129 | format: double 130 | example: 0 131 | status: 132 | type: string 133 | example: no-error 134 | version: 135 | type: string 136 | example: overstroomik webservice 1.0.0 137 | location: 138 | type: object 139 | properties: 140 | search_field: 141 | type: string 142 | description: | 143 | content of original search field 144 | example: 8232JN 145 | latitude: 146 | maximum: 90 147 | minimum: -90 148 | type: number 149 | description: | 150 | geocoded location 151 | example: 52.5066973961792 152 | longitude: 153 | maximum: 360 154 | minimum: 0 155 | type: number 156 | description: | 157 | geocoded location longitude 158 | example: 5.46887674785145 159 | rd_x: 160 | type: number 161 | description: "x coordinate in meters, geocoded location longitude transformed into EPSG:28992 \n" 162 | example: 160544.902 163 | rd_y: 164 | type: number 165 | description: | 166 | y coordinate in meters, geocoded location latitude transformed into EPSG:28992 167 | example: 502115.495 168 | address: 169 | type: string 170 | description: | 171 | geocoded adress (street/house number) 172 | example: Botter 11 173 | municipality: 174 | type: string 175 | description: | 176 | geocoded adress (municipality) 177 | example: Lelystad 178 | zipcode: 179 | pattern: \d{4}[A-Z]{2} 180 | type: string 181 | description: "geocoded zipcode \n" 182 | example: 8232JN 183 | data: 184 | type: object 185 | properties: 186 | flood_type: 187 | type: string 188 | description: | 189 | type of flooding area 190 | example: binnen dijkring, mogelijk overstroombaar 191 | enum: 192 | - binnen dijkring, mogelijk overstroombaar 193 | - buiten dijkring, geen hogegrond (buitendijks of buiten water) 194 | - buiten dijkring, hogegrond 195 | maximum_water_depth: 196 | minimum: 0 197 | type: number 198 | description: | 199 | maximum water depth in meters 200 | format: double 201 | example: 3.2242 202 | probability_of_flooding: 203 | type: string 204 | description: | 205 | expected frequency per year for flooding 206 | nullable: true 207 | example: 'kleine kans: 1/300 tot 1/3.000 per jaar' 208 | enum: 209 | - geen significante overstromingskans 210 | - 'grote kans: > 1/30 per jaar' 211 | - 'middelgrote kans: 1/30 tot 1/300 per jaar' 212 | - 'kleine kans: 1/300 tot 1/3.000 per jaar' 213 | - 'zeer kleine kans: 1/3.000 tot 1/30.000 per jaar' 214 | - 'extreem kleine kans: < 1/30.000 per jaar' 215 | evacuation_percentage: 216 | maximum: 100 217 | minimum: 0 218 | type: number 219 | description: | 220 | expected evacuation percentage 221 | if percentage ≤ 20 then ‘vrijwel niemand kan het gebied verlaten’ 222 | if percentage ≤ 40 then ‘een klein deel kan het gebied verlaten’ 223 | if percentage ≤ 60 then ‘ongeveer de helft kan het gebied verlaten’ 224 | if percentage ≤ 80 then ‘een groot deel kan het gebied verlaten’ 225 | if percentage > 80 then ‘vrijwel iedereen kan het gebied verlaten’ 226 | format: double 227 | example: 35 228 | safety_board_id: 229 | type: integer 230 | description: | 231 | unique id of safety board 232 | example: 12 233 | -------------------------------------------------------------------------------- /tests/performance/benchmark.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Benchmark\n", 8 | "This is the performance measurement of the geoserver LIWO production" 9 | ] 10 | }, 11 | { 12 | "cell_type": "code", 13 | "execution_count": 1, 14 | "metadata": {}, 15 | "outputs": [ 16 | { 17 | "name": "stdout", 18 | "output_type": "stream", 19 | "text": [ 20 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 21 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 22 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 23 | "\n", 24 | "Benchmarking geodata.basisinformatie-overstromingen.nl (be patient).....done\n", 25 | "\n", 26 | "\n", 27 | "Server Software: Apache-Coyote/1.1\n", 28 | "Server Hostname: geodata.basisinformatie-overstromingen.nl\n", 29 | "Server Port: 443\n", 30 | "SSL/TLS Protocol: TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128\n", 31 | "Server Temp Key: ECDH P-256 256 bits\n", 32 | "TLS Server Name: geodata.basisinformatie-overstromingen.nl\n", 33 | "\n", 34 | "Document Path: /geoserver/wms?service=WMS&request=GetMap&layers=MEGO%3AMEGO_overstromingNL_WaterdiepteKlasse_Group&styles=&format=image%2Fpng&transparent=true&version=1.1.1&baselayer=false&tiled=true&height=256&width=256&srs=EPSG%3A28992&bbox=155000.00011739583,463000.00044581917,168762.56012993932,476762.560\n", 35 | "Document Length: 14104 bytes\n", 36 | "\n", 37 | "Concurrency Level: 5\n", 38 | "Time taken for tests: 2.383 seconds\n", 39 | "Complete requests: 20\n", 40 | "Failed requests: 0\n", 41 | "Total transferred: 289994 bytes\n", 42 | "HTML transferred: 282080 bytes\n", 43 | "Requests per second: 8.39 [#/sec] (mean)\n", 44 | "Time per request: 595.736 [ms] (mean)\n", 45 | "Time per request: 119.147 [ms] (mean, across all concurrent requests)\n", 46 | "Transfer rate: 118.84 [Kbytes/sec] received\n", 47 | "\n", 48 | "Connection Times (ms)\n", 49 | " min mean[+/-sd] median max\n", 50 | "Connect: 134 174 27.2 177 228\n", 51 | "Processing: 42 117 258.1 60 1211\n", 52 | "Waiting: 37 110 259.1 53 1210\n", 53 | "Total: 176 291 266.4 232 1416\n", 54 | "\n", 55 | "Percentage of the requests served within a certain time (ms)\n", 56 | " 50% 232\n", 57 | " 66% 253\n", 58 | " 75% 255\n", 59 | " 80% 271\n", 60 | " 90% 291\n", 61 | " 95% 1416\n", 62 | " 98% 1416\n", 63 | " 99% 1416\n", 64 | " 100% 1416 (longest request)\n" 65 | ] 66 | } 67 | ], 68 | "source": [ 69 | "server_url = 'https://geodata.basisinformatie-overstromingen.nl'\n", 70 | "path = '/geoserver/wms?service=WMS&request=GetMap&layers=MEGO%3AMEGO_overstromingNL_WaterdiepteKlasse_Group&styles=&format=image%2Fpng&transparent=true&version=1.1.1&baselayer=false&tiled=true&height=256&width=256&srs=EPSG%3A28992&bbox=155000.00011739583,463000.00044581917,168762.56012993932,476762.560'\n", 71 | "url = f'{server_url}{path}'\n", 72 | "!ab -n 20 -c 5 \"$url\"" 73 | ] 74 | }, 75 | { 76 | "cell_type": "markdown", 77 | "metadata": {}, 78 | "source": [ 79 | "This is the performance measurement of the backend LIWO production" 80 | ] 81 | }, 82 | { 83 | "cell_type": "code", 84 | "execution_count": 2, 85 | "metadata": {}, 86 | "outputs": [ 87 | { 88 | "name": "stdout", 89 | "output_type": "stream", 90 | "text": [ 91 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 92 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 93 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 94 | "\n", 95 | "Benchmarking geodata.basisinformatie-overstromingen.nl (be patient).....done\n", 96 | "\n", 97 | "\n", 98 | "Server Software: Apache-Coyote/1.1\n", 99 | "Server Hostname: geodata.basisinformatie-overstromingen.nl\n", 100 | "Server Port: 443\n", 101 | "SSL/TLS Protocol: TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128\n", 102 | "Server Temp Key: ECDH P-256 256 bits\n", 103 | "TLS Server Name: geodata.basisinformatie-overstromingen.nl\n", 104 | "\n", 105 | "Document Path: /overstroom-ik.html?adres=2631TG&latitude=&longiqtude=\n", 106 | "Document Length: 127 bytes\n", 107 | "\n", 108 | "Concurrency Level: 5\n", 109 | "Time taken for tests: 1.094 seconds\n", 110 | "Complete requests: 20\n", 111 | "Failed requests: 0\n", 112 | "Non-2xx responses: 20\n", 113 | "Total transferred: 9026 bytes\n", 114 | "HTML transferred: 2540 bytes\n", 115 | "Requests per second: 18.28 [#/sec] (mean)\n", 116 | "Time per request: 273.550 [ms] (mean)\n", 117 | "Time per request: 54.710 [ms] (mean, across all concurrent requests)\n", 118 | "Transfer rate: 8.06 [Kbytes/sec] received\n", 119 | "\n", 120 | "Connection Times (ms)\n", 121 | " min mean[+/-sd] median max\n", 122 | "Connect: 140 164 18.3 165 205\n", 123 | "Processing: 34 44 7.4 45 59\n", 124 | "Waiting: 33 43 7.6 42 59\n", 125 | "Total: 175 208 20.7 211 257\n", 126 | "\n", 127 | "Percentage of the requests served within a certain time (ms)\n", 128 | " 50% 211\n", 129 | " 66% 214\n", 130 | " 75% 225\n", 131 | " 80% 225\n", 132 | " 90% 235\n", 133 | " 95% 257\n", 134 | " 98% 257\n", 135 | " 99% 257\n", 136 | " 100% 257 (longest request)\n" 137 | ] 138 | } 139 | ], 140 | "source": [ 141 | "server_url = 'https://geodata.basisinformatie-overstromingen.nl'\n", 142 | "path = '/overstroom-ik.html?adres=2631TG&latitude=&longiqtude='\n", 143 | "url = f'{server_url}{path}'\n", 144 | "!ab -n 20 -c 5 \"$url\"" 145 | ] 146 | }, 147 | { 148 | "cell_type": "markdown", 149 | "metadata": {}, 150 | "source": [ 151 | "This is the performance measurement of the backend overstroomik test environment" 152 | ] 153 | }, 154 | { 155 | "cell_type": "code", 156 | "execution_count": 3, 157 | "metadata": {}, 158 | "outputs": [ 159 | { 160 | "name": "stdout", 161 | "output_type": "stream", 162 | "text": [ 163 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 164 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 165 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 166 | "\n", 167 | "Benchmarking 34.120.151.162 (be patient).....done\n", 168 | "\n", 169 | "\n", 170 | "Server Software: uvicorn\n", 171 | "Server Hostname: 34.120.151.162\n", 172 | "Server Port: 80\n", 173 | "\n", 174 | "Document Path: /\n", 175 | "Document Length: 37 bytes\n", 176 | "\n", 177 | "Concurrency Level: 5\n", 178 | "Time taken for tests: 0.195 seconds\n", 179 | "Complete requests: 20\n", 180 | "Failed requests: 0\n", 181 | "Total transferred: 3580 bytes\n", 182 | "HTML transferred: 740 bytes\n", 183 | "Requests per second: 102.38 [#/sec] (mean)\n", 184 | "Time per request: 48.839 [ms] (mean)\n", 185 | "Time per request: 9.768 [ms] (mean, across all concurrent requests)\n", 186 | "Transfer rate: 17.90 [Kbytes/sec] received\n", 187 | "\n", 188 | "Connection Times (ms)\n", 189 | " min mean[+/-sd] median max\n", 190 | "Connect: 7 12 3.5 12 20\n", 191 | "Processing: 16 28 12.9 22 58\n", 192 | "Waiting: 16 27 11.9 21 54\n", 193 | "Total: 28 40 11.6 37 66\n", 194 | "\n", 195 | "Percentage of the requests served within a certain time (ms)\n", 196 | " 50% 37\n", 197 | " 66% 42\n", 198 | " 75% 48\n", 199 | " 80% 56\n", 200 | " 90% 61\n", 201 | " 95% 66\n", 202 | " 98% 66\n", 203 | " 99% 66\n", 204 | " 100% 66 (longest request)\n" 205 | ] 206 | } 207 | ], 208 | "source": [ 209 | "server_url = 'http://34.120.151.162'\n", 210 | "path = '/'\n", 211 | "url = f'{server_url}{path}'\n", 212 | "!ab -n 20 -c 5 \"$url\"" 213 | ] 214 | }, 215 | { 216 | "cell_type": "markdown", 217 | "metadata": {}, 218 | "source": [ 219 | "This is the performance measurement of the backend overstroomik test environment (function by_rd)" 220 | ] 221 | }, 222 | { 223 | "cell_type": "code", 224 | "execution_count": 3, 225 | "metadata": {}, 226 | "outputs": [ 227 | { 228 | "name": "stdout", 229 | "output_type": "stream", 230 | "text": [ 231 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 232 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 233 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 234 | "\n", 235 | "Benchmarking 34.120.151.162 (be patient).....done\n", 236 | "\n", 237 | "\n", 238 | "Server Software: uvicorn\n", 239 | "Server Hostname: 34.120.151.162\n", 240 | "Server Port: 80\n", 241 | "\n", 242 | "Document Path: /by_rd?x=160544.9305929368&y=502116.2403875955\n", 243 | "Document Length: 405 bytes\n", 244 | "\n", 245 | "Concurrency Level: 5\n", 246 | "Time taken for tests: 10.510 seconds\n", 247 | "Complete requests: 5\n", 248 | "Failed requests: 2\n", 249 | " (Connect: 0, Receive: 0, Length: 2, Exceptions: 0)\n", 250 | "Total transferred: 2818 bytes\n", 251 | "HTML transferred: 2103 bytes\n", 252 | "Requests per second: 0.48 [#/sec] (mean)\n", 253 | "Time per request: 10509.843 [ms] (mean)\n", 254 | "Time per request: 2101.969 [ms] (mean, across all concurrent requests)\n", 255 | "Transfer rate: 0.26 [Kbytes/sec] received\n", 256 | "\n", 257 | "Connection Times (ms)\n", 258 | " min mean[+/-sd] median max\n", 259 | "Connect: 8 30 12.3 35 35\n", 260 | "Processing: 482 2736 3968.0 1365 9789\n", 261 | "Waiting: 482 2735 3965.6 1365 9784\n", 262 | "Total: 517 2766 3971.6 1401 9824\n", 263 | "\n", 264 | "Percentage of the requests served within a certain time (ms)\n", 265 | " 50% 1119\n", 266 | " 66% 1682\n", 267 | " 75% 1682\n", 268 | " 80% 9824\n", 269 | " 90% 9824\n", 270 | " 95% 9824\n", 271 | " 98% 9824\n", 272 | " 99% 9824\n", 273 | " 100% 9824 (longest request)\n", 274 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 275 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 276 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 277 | "\n", 278 | "Benchmarking 34.120.151.162 (be patient).....done\n", 279 | "\n", 280 | "\n", 281 | "Server Software: uvicorn\n", 282 | "Server Hostname: 34.120.151.162\n", 283 | "Server Port: 80\n", 284 | "\n", 285 | "Document Path: /by_rd?x=160544.9305929368&y=502116.2403875955\n", 286 | "Document Length: 444 bytes\n", 287 | "\n", 288 | "Concurrency Level: 5\n", 289 | "Time taken for tests: 1.491 seconds\n", 290 | "Complete requests: 5\n", 291 | "Failed requests: 1\n", 292 | " (Connect: 0, Receive: 0, Length: 1, Exceptions: 0)\n", 293 | "Total transferred: 2896 bytes\n", 294 | "HTML transferred: 2181 bytes\n", 295 | "Requests per second: 3.35 [#/sec] (mean)\n", 296 | "Time per request: 1490.546 [ms] (mean)\n", 297 | "Time per request: 298.109 [ms] (mean, across all concurrent requests)\n", 298 | "Transfer rate: 1.90 [Kbytes/sec] received\n", 299 | "\n", 300 | "Connection Times (ms)\n", 301 | " min mean[+/-sd] median max\n", 302 | "Connect: 7 12 10.0 8 30\n", 303 | "Processing: 370 844 300.9 1025 1081\n", 304 | "Waiting: 370 843 300.4 1023 1081\n", 305 | "Total: 401 857 292.5 1033 1090\n", 306 | "\n", 307 | "Percentage of the requests served within a certain time (ms)\n", 308 | " 50% 1022\n", 309 | " 66% 1045\n", 310 | " 75% 1045\n", 311 | " 80% 1090\n", 312 | " 90% 1090\n", 313 | " 95% 1090\n", 314 | " 98% 1090\n", 315 | " 99% 1090\n", 316 | " 100% 1090 (longest request)\n", 317 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 318 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 319 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 320 | "\n", 321 | "Benchmarking 34.120.151.162 (be patient).....done\n", 322 | "\n", 323 | "\n", 324 | "Server Software: uvicorn\n", 325 | "Server Hostname: 34.120.151.162\n", 326 | "Server Port: 80\n", 327 | "\n", 328 | "Document Path: /by_rd?x=160544.9305929368&y=502116.2403875955\n", 329 | "Document Length: 405 bytes\n", 330 | "\n", 331 | "Concurrency Level: 5\n", 332 | "Time taken for tests: 2.589 seconds\n", 333 | "Complete requests: 5\n", 334 | "Failed requests: 3\n", 335 | " (Connect: 0, Receive: 0, Length: 3, Exceptions: 0)\n", 336 | "Total transferred: 2857 bytes\n", 337 | "HTML transferred: 2142 bytes\n", 338 | "Requests per second: 1.93 [#/sec] (mean)\n", 339 | "Time per request: 2588.963 [ms] (mean)\n", 340 | "Time per request: 517.793 [ms] (mean, across all concurrent requests)\n", 341 | "Transfer rate: 1.08 [Kbytes/sec] received\n", 342 | "\n", 343 | "Connection Times (ms)\n", 344 | " min mean[+/-sd] median max\n", 345 | "Connect: 7 9 0.6 9 9\n", 346 | "Processing: 884 1311 384.3 1549 1668\n", 347 | "Waiting: 884 1311 384.2 1548 1668\n", 348 | "Total: 893 1319 384.6 1558 1677\n", 349 | "\n", 350 | "Percentage of the requests served within a certain time (ms)\n", 351 | " 50% 1523\n", 352 | " 66% 1592\n", 353 | " 75% 1592\n", 354 | " 80% 1677\n", 355 | " 90% 1677\n", 356 | " 95% 1677\n", 357 | " 98% 1677\n", 358 | " 99% 1677\n", 359 | " 100% 1677 (longest request)\n", 360 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 361 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 362 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 363 | "\n", 364 | "Benchmarking 34.120.151.162 (be patient).....done\n", 365 | "\n", 366 | "\n", 367 | "Server Software: uvicorn\n", 368 | "Server Hostname: 34.120.151.162\n", 369 | "Server Port: 80\n", 370 | "\n", 371 | "Document Path: /by_rd?x=160544.9305929368&y=502116.2403875955\n", 372 | "Document Length: 405 bytes\n", 373 | "\n", 374 | "Concurrency Level: 5\n", 375 | "Time taken for tests: 1.316 seconds\n", 376 | "Complete requests: 5\n", 377 | "Failed requests: 4\n", 378 | " (Connect: 0, Receive: 0, Length: 4, Exceptions: 0)\n", 379 | "Total transferred: 2896 bytes\n", 380 | "HTML transferred: 2181 bytes\n", 381 | "Requests per second: 3.80 [#/sec] (mean)\n", 382 | "Time per request: 1315.984 [ms] (mean)\n", 383 | "Time per request: 263.197 [ms] (mean, across all concurrent requests)\n", 384 | "Transfer rate: 2.15 [Kbytes/sec] received\n", 385 | "\n", 386 | "Connection Times (ms)\n", 387 | " min mean[+/-sd] median max\n", 388 | "Connect: 11 14 6.1 11 25\n", 389 | "Processing: 418 622 203.0 706 844\n", 390 | "Waiting: 418 622 203.1 706 844\n", 391 | "Total: 430 636 199.9 717 855\n", 392 | "\n", 393 | "Percentage of the requests served within a certain time (ms)\n", 394 | " 50% 604\n", 395 | " 66% 830\n", 396 | " 75% 830\n", 397 | " 80% 855\n", 398 | " 90% 855\n", 399 | " 95% 855\n", 400 | " 98% 855\n", 401 | " 99% 855\n", 402 | " 100% 855 (longest request)\n", 403 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 404 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 405 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 406 | "\n", 407 | "Benchmarking 34.120.151.162 (be patient).....done\n", 408 | "\n", 409 | "\n", 410 | "Server Software: uvicorn\n", 411 | "Server Hostname: 34.120.151.162\n", 412 | "Server Port: 80\n", 413 | "\n", 414 | "Document Path: /by_rd?x=160544.9305929368&y=502116.2403875955\n", 415 | "Document Length: 444 bytes\n", 416 | "\n", 417 | "Concurrency Level: 5\n", 418 | "Time taken for tests: 1.447 seconds\n", 419 | "Complete requests: 5\n", 420 | "Failed requests: 0\n", 421 | "Total transferred: 2935 bytes\n", 422 | "HTML transferred: 2220 bytes\n", 423 | "Requests per second: 3.46 [#/sec] (mean)\n", 424 | "Time per request: 1446.686 [ms] (mean)\n", 425 | "Time per request: 289.337 [ms] (mean, across all concurrent requests)\n", 426 | "Transfer rate: 1.98 [Kbytes/sec] received\n", 427 | "\n", 428 | "Connection Times (ms)\n", 429 | " min mean[+/-sd] median max\n", 430 | "Connect: 11 13 5.3 11 23\n", 431 | "Processing: 512 676 194.8 727 901\n", 432 | "Waiting: 510 675 195.3 727 901\n", 433 | "Total: 523 689 192.3 738 912\n", 434 | "\n", 435 | "Percentage of the requests served within a certain time (ms)\n", 436 | " 50% 593\n", 437 | " 66% 883\n", 438 | " 75% 883\n", 439 | " 80% 912\n", 440 | " 90% 912\n", 441 | " 95% 912\n", 442 | " 98% 912\n", 443 | " 99% 912\n", 444 | " 100% 912 (longest request)\n", 445 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 446 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 447 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 448 | "\n", 449 | "Benchmarking 34.120.151.162 (be patient).....done\n", 450 | "\n", 451 | "\n", 452 | "Server Software: uvicorn\n", 453 | "Server Hostname: 34.120.151.162\n", 454 | "Server Port: 80\n", 455 | "\n", 456 | "Document Path: /by_rd?x=160544.9305929368&y=502116.2403875955\n", 457 | "Document Length: 444 bytes\n", 458 | "\n", 459 | "Concurrency Level: 5\n", 460 | "Time taken for tests: 1.562 seconds\n", 461 | "Complete requests: 5\n", 462 | "Failed requests: 4\n", 463 | " (Connect: 0, Receive: 0, Length: 4, Exceptions: 0)\n", 464 | "Total transferred: 2779 bytes\n", 465 | "HTML transferred: 2064 bytes\n", 466 | "Requests per second: 3.20 [#/sec] (mean)\n", 467 | "Time per request: 1562.051 [ms] (mean)\n", 468 | "Time per request: 312.410 [ms] (mean, across all concurrent requests)\n", 469 | "Transfer rate: 1.74 [Kbytes/sec] received\n", 470 | "\n", 471 | "Connection Times (ms)\n", 472 | " min mean[+/-sd] median max\n", 473 | "Connect: 7 10 1.3 10 11\n", 474 | "Processing: 380 901 334.2 1104 1164\n", 475 | "Waiting: 380 900 334.3 1104 1164\n", 476 | "Total: 387 910 335.4 1114 1175\n", 477 | "\n", 478 | "Percentage of the requests served within a certain time (ms)\n", 479 | " 50% 1087\n", 480 | " 66% 1141\n", 481 | " 75% 1141\n", 482 | " 80% 1175\n", 483 | " 90% 1175\n", 484 | " 95% 1175\n", 485 | " 98% 1175\n", 486 | " 99% 1175\n", 487 | " 100% 1175 (longest request)\n", 488 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 489 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 490 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 491 | "\n" 492 | ] 493 | }, 494 | { 495 | "name": "stdout", 496 | "output_type": "stream", 497 | "text": [ 498 | "Benchmarking 34.120.151.162 (be patient).....done\n", 499 | "\n", 500 | "\n", 501 | "Server Software: uvicorn\n", 502 | "Server Hostname: 34.120.151.162\n", 503 | "Server Port: 80\n", 504 | "\n", 505 | "Document Path: /by_rd?x=160544.9305929368&y=502116.2403875955\n", 506 | "Document Length: 444 bytes\n", 507 | "\n", 508 | "Concurrency Level: 5\n", 509 | "Time taken for tests: 1.285 seconds\n", 510 | "Complete requests: 5\n", 511 | "Failed requests: 2\n", 512 | " (Connect: 0, Receive: 0, Length: 2, Exceptions: 0)\n", 513 | "Total transferred: 2857 bytes\n", 514 | "HTML transferred: 2142 bytes\n", 515 | "Requests per second: 3.89 [#/sec] (mean)\n", 516 | "Time per request: 1285.049 [ms] (mean)\n", 517 | "Time per request: 257.010 [ms] (mean, across all concurrent requests)\n", 518 | "Transfer rate: 2.17 [Kbytes/sec] received\n", 519 | "\n", 520 | "Connection Times (ms)\n", 521 | " min mean[+/-sd] median max\n", 522 | "Connect: 8 18 20.5 10 55\n", 523 | "Processing: 529 618 67.6 650 693\n", 524 | "Waiting: 527 617 68.4 650 693\n", 525 | "Total: 575 636 55.0 659 703\n", 526 | "\n", 527 | "Percentage of the requests served within a certain time (ms)\n", 528 | " 50% 656\n", 529 | " 66% 662\n", 530 | " 75% 662\n", 531 | " 80% 703\n", 532 | " 90% 703\n", 533 | " 95% 703\n", 534 | " 98% 703\n", 535 | " 99% 703\n", 536 | " 100% 703 (longest request)\n", 537 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 538 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 539 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 540 | "\n", 541 | "Benchmarking 34.120.151.162 (be patient).....done\n", 542 | "\n", 543 | "\n", 544 | "Server Software: uvicorn\n", 545 | "Server Hostname: 34.120.151.162\n", 546 | "Server Port: 80\n", 547 | "\n", 548 | "Document Path: /by_rd?x=160544.9305929368&y=502116.2403875955\n", 549 | "Document Length: 444 bytes\n", 550 | "\n", 551 | "Concurrency Level: 5\n", 552 | "Time taken for tests: 1.838 seconds\n", 553 | "Complete requests: 5\n", 554 | "Failed requests: 1\n", 555 | " (Connect: 0, Receive: 0, Length: 1, Exceptions: 0)\n", 556 | "Total transferred: 2896 bytes\n", 557 | "HTML transferred: 2181 bytes\n", 558 | "Requests per second: 2.72 [#/sec] (mean)\n", 559 | "Time per request: 1838.330 [ms] (mean)\n", 560 | "Time per request: 367.666 [ms] (mean, across all concurrent requests)\n", 561 | "Transfer rate: 1.54 [Kbytes/sec] received\n", 562 | "\n", 563 | "Connection Times (ms)\n", 564 | " min mean[+/-sd] median max\n", 565 | "Connect: 8 8 0.5 9 9\n", 566 | "Processing: 347 1156 482.0 1444 1474\n", 567 | "Waiting: 347 1156 482.0 1444 1474\n", 568 | "Total: 356 1165 481.8 1452 1482\n", 569 | "WARNING: The median and mean for the initial connection time are not within a normal deviation\n", 570 | " These results are probably not that reliable.\n", 571 | "\n", 572 | "Percentage of the requests served within a certain time (ms)\n", 573 | " 50% 1426\n", 574 | " 66% 1479\n", 575 | " 75% 1479\n", 576 | " 80% 1482\n", 577 | " 90% 1482\n", 578 | " 95% 1482\n", 579 | " 98% 1482\n", 580 | " 99% 1482\n", 581 | " 100% 1482 (longest request)\n", 582 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 583 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 584 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 585 | "\n", 586 | "Benchmarking 34.120.151.162 (be patient).....done\n", 587 | "\n", 588 | "\n", 589 | "Server Software: uvicorn\n", 590 | "Server Hostname: 34.120.151.162\n", 591 | "Server Port: 80\n", 592 | "\n", 593 | "Document Path: /by_rd?x=160544.9305929368&y=502116.2403875955\n", 594 | "Document Length: 444 bytes\n", 595 | "\n", 596 | "Concurrency Level: 5\n", 597 | "Time taken for tests: 1.952 seconds\n", 598 | "Complete requests: 5\n", 599 | "Failed requests: 4\n", 600 | " (Connect: 0, Receive: 0, Length: 4, Exceptions: 0)\n", 601 | "Total transferred: 2779 bytes\n", 602 | "HTML transferred: 2064 bytes\n", 603 | "Requests per second: 2.56 [#/sec] (mean)\n", 604 | "Time per request: 1952.063 [ms] (mean)\n", 605 | "Time per request: 390.413 [ms] (mean, across all concurrent requests)\n", 606 | "Transfer rate: 1.39 [Kbytes/sec] received\n", 607 | "\n", 608 | "Connection Times (ms)\n", 609 | " min mean[+/-sd] median max\n", 610 | "Connect: 8 8 0.5 8 9\n", 611 | "Processing: 457 1059 478.1 1360 1478\n", 612 | "Waiting: 456 1059 478.3 1360 1477\n", 613 | "Total: 466 1068 477.7 1368 1486\n", 614 | "\n", 615 | "Percentage of the requests served within a certain time (ms)\n", 616 | " 50% 1263\n", 617 | " 66% 1473\n", 618 | " 75% 1473\n", 619 | " 80% 1486\n", 620 | " 90% 1486\n", 621 | " 95% 1486\n", 622 | " 98% 1486\n", 623 | " 99% 1486\n", 624 | " 100% 1486 (longest request)\n", 625 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 626 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 627 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 628 | "\n", 629 | "Benchmarking 34.120.151.162 (be patient).....done\n", 630 | "\n", 631 | "\n", 632 | "Server Software: uvicorn\n", 633 | "Server Hostname: 34.120.151.162\n", 634 | "Server Port: 80\n", 635 | "\n", 636 | "Document Path: /by_rd?x=160544.9305929368&y=502116.2403875955\n", 637 | "Document Length: 444 bytes\n", 638 | "\n", 639 | "Concurrency Level: 5\n", 640 | "Time taken for tests: 2.043 seconds\n", 641 | "Complete requests: 5\n", 642 | "Failed requests: 2\n", 643 | " (Connect: 0, Receive: 0, Length: 2, Exceptions: 0)\n", 644 | "Total transferred: 2857 bytes\n", 645 | "HTML transferred: 2142 bytes\n", 646 | "Requests per second: 2.45 [#/sec] (mean)\n", 647 | "Time per request: 2043.063 [ms] (mean)\n", 648 | "Time per request: 408.613 [ms] (mean, across all concurrent requests)\n", 649 | "Transfer rate: 1.37 [Kbytes/sec] received\n", 650 | "\n", 651 | "Connection Times (ms)\n", 652 | " min mean[+/-sd] median max\n", 653 | "Connect: 7 8 1.1 8 10\n", 654 | "Processing: 407 1188 539.6 1538 1621\n", 655 | "Waiting: 405 1187 539.7 1536 1619\n", 656 | "Total: 417 1196 538.7 1545 1628\n", 657 | "\n", 658 | "Percentage of the requests served within a certain time (ms)\n", 659 | " 50% 1533\n", 660 | " 66% 1556\n", 661 | " 75% 1556\n", 662 | " 80% 1628\n", 663 | " 90% 1628\n", 664 | " 95% 1628\n", 665 | " 98% 1628\n", 666 | " 99% 1628\n", 667 | " 100% 1628 (longest request)\n" 668 | ] 669 | } 670 | ], 671 | "source": [ 672 | "server_url = 'http://34.120.151.162'\n", 673 | "path = '/by_rd?x={x}&y={y}'\n", 674 | "url = f'{server_url}{path}'\n", 675 | "\n", 676 | "x = 160544.902\n", 677 | "y = 502115.495\n", 678 | "import random\n", 679 | "for i in range(10):\n", 680 | " url = url.format(x=x + random.random(),y =y + random.random())\n", 681 | " !ab -n 5 -c 5 \"$url\"" 682 | ] 683 | }, 684 | { 685 | "cell_type": "code", 686 | "execution_count": 2, 687 | "metadata": {}, 688 | "outputs": [ 689 | { 690 | "name": "stdout", 691 | "output_type": "stream", 692 | "text": [ 693 | "This is ApacheBench, Version 2.3 <$Revision: 1843412 $>\n", 694 | "Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n", 695 | "Licensed to The Apache Software Foundation, http://www.apache.org/\n", 696 | "\n", 697 | "Benchmarking 34.120.151.162 (be patient).....done\n", 698 | "\n", 699 | "\n", 700 | "Server Software: \n", 701 | "Server Hostname: 34.120.151.162\n", 702 | "Server Port: 80\n", 703 | "\n", 704 | "Document Path: /geoserver/wms?service=WMS&request=GetMap&layers=MEGO%3AMEGO_overstromingNL_WaterdiepteKlasse_Group&styles=&format=image%2Fpng&transparent=true&version=1.1.1&baselayer=false&tiled=true&height=256&width=256&srs=EPSG%3A28992&bbox=155000.00011739583,463000.00044581917,168762.56012993932,476762.560\n", 705 | "Document Length: 394 bytes\n", 706 | "\n", 707 | "Concurrency Level: 5\n", 708 | "Time taken for tests: 0.426 seconds\n", 709 | "Complete requests: 20\n", 710 | "Failed requests: 0\n", 711 | "Total transferred: 11640 bytes\n", 712 | "HTML transferred: 7880 bytes\n", 713 | "Requests per second: 46.97 [#/sec] (mean)\n", 714 | "Time per request: 106.447 [ms] (mean)\n", 715 | "Time per request: 21.289 [ms] (mean, across all concurrent requests)\n", 716 | "Transfer rate: 26.70 [Kbytes/sec] received\n", 717 | "\n", 718 | "Connection Times (ms)\n", 719 | " min mean[+/-sd] median max\n", 720 | "Connect: 8 11 2.1 11 15\n", 721 | "Processing: 26 67 52.7 56 274\n", 722 | "Waiting: 24 65 53.2 54 274\n", 723 | "Total: 35 78 52.2 67 284\n", 724 | "\n", 725 | "Percentage of the requests served within a certain time (ms)\n", 726 | " 50% 67\n", 727 | " 66% 72\n", 728 | " 75% 83\n", 729 | " 80% 85\n", 730 | " 90% 108\n", 731 | " 95% 284\n", 732 | " 98% 284\n", 733 | " 99% 284\n", 734 | " 100% 284 (longest request)\n" 735 | ] 736 | } 737 | ], 738 | "source": [ 739 | "server_url = 'http://34.120.151.162'\n", 740 | "path = '/geoserver/wms?service=WMS&request=GetMap&layers=MEGO%3AMEGO_overstromingNL_WaterdiepteKlasse_Group&styles=&format=image%2Fpng&transparent=true&version=1.1.1&baselayer=false&tiled=true&height=256&width=256&srs=EPSG%3A28992&bbox=155000.00011739583,463000.00044581917,168762.56012993932,476762.560'\n", 741 | "url = f'{server_url}{path}'\n", 742 | "!ab -n 20 -c 5 \"$url\"\n" 743 | ] 744 | }, 745 | { 746 | "cell_type": "code", 747 | "execution_count": null, 748 | "metadata": {}, 749 | "outputs": [], 750 | "source": [] 751 | } 752 | ], 753 | "metadata": { 754 | "kernelspec": { 755 | "display_name": "Python 3", 756 | "language": "python", 757 | "name": "python3" 758 | }, 759 | "language_info": { 760 | "codemirror_mode": { 761 | "name": "ipython", 762 | "version": 3 763 | }, 764 | "file_extension": ".py", 765 | "mimetype": "text/x-python", 766 | "name": "python", 767 | "nbconvert_exporter": "python", 768 | "pygments_lexer": "ipython3", 769 | "version": "3.8.6" 770 | } 771 | }, 772 | "nbformat": 4, 773 | "nbformat_minor": 4 774 | } 775 | --------------------------------------------------------------------------------