Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging current state of changes #4

Open
wants to merge 89 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
84d7e6c
modified metadata
sensum-zz Sep 30, 2019
66e3dc2
Remove pycache files
ruester Oct 1, 2019
b21d606
Add pyc files to .gitignore
ruester Oct 1, 2019
101d067
Update schema files with current repository version
ruester Oct 1, 2019
4453ffe
Rename Dockerfile
ruester Oct 1, 2019
a090879
Update Dockerfile
ruester Oct 1, 2019
80545aa
Update SARA_v1.0_prop.csv with current repository version
ruester Oct 1, 2019
8699ea0
updated modelcreator
sensum-zz Oct 1, 2019
3b02e42
Merge branch 'master' of https://github.com/gfzriesgos/assetmaster
sensum-zz Oct 1, 2019
afeabac
fixed a bug in the prop csv file of SARA_v1.0 model
sensum-zz Oct 1, 2019
7c88946
Remove .DS_Store file
ruester Oct 1, 2019
af01681
updated local tests
sensum-zz Oct 1, 2019
2633d64
Improve Dockerfile for caching
ruester Oct 2, 2019
9f4c7dd
Add configuration file for Travis CI
ruester Oct 2, 2019
837af21
Add build badge for Docker Hub to README.md
ruester Oct 14, 2019
e6a0b31
Add docker build to CI configuration
ruester Oct 14, 2019
f05cb02
Added env to gitignore to support virtual environments
nbrinckm Oct 18, 2019
24fdf5b
Assetmaster now puts empty files out
nbrinckm Oct 24, 2019
64a57de
Add execution of test script to CI configuration
ruester Oct 24, 2019
6b56833
Merge pull request #1 from gfzriesgos/fix-empty-output
ruester Oct 24, 2019
e0c43de
Remove unneeded .gitignore in output directory
ruester Oct 24, 2019
9b1fc0c
Keep output directory in repository
ruester Oct 24, 2019
47e2349
Added the possibility to insert multiple gpkg models for different co…
nbrinckm Oct 24, 2019
6ff276b
Merge pull request #2 from gfzriesgos/multi-gpkg-files-per-schema-for…
nbrinckm Oct 24, 2019
6962fba
Files and script provided by camilo
nbrinckm Oct 24, 2019
eea0cf8
Renamed old file from Camilo
nbrinckm Oct 24, 2019
9729c72
Added a version of the valparaiso gpgk (before test)
nbrinckm Oct 24, 2019
8a8bba5
Fixed a typo, added a test and rebuild the exposure model for valparaiso
nbrinckm Oct 24, 2019
57bedb6
Replaced the current exposure model for chile with the one for just v…
nbrinckm Oct 28, 2019
dad08ab
Changed bbox
nbrinckm Oct 28, 2019
2625dc6
Merge pull request #3 from gfzriesgos/valparaiso-gpkg
ruester Oct 28, 2019
b7cbc43
Added the exposure model for lima + update of the meta.json and prop.…
nbrinckm Nov 7, 2019
d3c69ea
Travis CI: Do not execute python notebook in CI
ruester Nov 8, 2019
85704d8
Merge pull request #4 from gfzriesgos/lima-gpkg
ruester Nov 8, 2019
a9ecfaa
Added the exposure models for ecuador + removed nrml output and relat…
nbrinckm Nov 14, 2019
1029402
Removed the output for nrml from the wps process description
nbrinckm Nov 14, 2019
62b363b
Merge pull request #5 from gfzriesgos/adding-ecuador-exposure-models
ruester Nov 14, 2019
280725e
Removed temporary gpkg files out of the repo
nbrinckm Feb 6, 2020
15af0a3
Replaced the exposure model for valparaiso
nbrinckm Feb 6, 2020
4aafe90
Travis CI: Fix installation of Rtree
ruester Feb 11, 2020
6f2ac19
Added license headers
nbrinckm Jun 22, 2021
5cc38d0
Added citation & project information
nbrinckm Jun 22, 2021
095fafd
Added newline at EOF
nbrinckm Oct 11, 2021
5c0fd9a
Keep newline
nbrinckm Oct 11, 2021
1605097
Fixed remaining files with end of file newline issue
nbrinckm Oct 11, 2021
ebb224b
Use citation string with full first names
nbrinckm Oct 11, 2021
621ae7c
Merge pull request #6 from gfzriesgos/add-copyright-statnement-and-di…
nbrinckm Oct 11, 2021
d43cdac
Defined allowed values for the sub models
nbrinckm Oct 11, 2021
d05f549
Removed old lima model
nbrinckm Oct 11, 2021
8e6809a
Moved ecuador exposure models in subfolders
nbrinckm Oct 11, 2021
0ce0faf
Changed names for supported models
nbrinckm Oct 11, 2021
20b3a01
Added mechanism to use specific models
nbrinckm Oct 11, 2021
2918420
Added lima exposure models
nbrinckm Oct 11, 2021
e3e33b2
Added valparaiso models
nbrinckm Oct 11, 2021
90a95ba
Merge pull request #7 from gfzriesgos/add-submodule-dispatch
nbrinckm Oct 26, 2021
0fc532a
Use full legal name for GFZ copyright
nbrinckm Nov 18, 2021
9876a4d
Merge tag '1.0'
nbrinckm Nov 18, 2021
1e41995
Apply fixes from black
ruester Nov 16, 2021
89fdbc5
Fix filenames in test script
ruester Nov 16, 2021
1cb3e06
Switch to use GitLab CI instead of Travis CI
ruester Nov 16, 2021
d98583c
CI: Use separate job for each check
ruester Nov 18, 2021
8ec452d
Merge branch 'separate-ci-jobs' into 'master'
gfzriesgos-bot Nov 19, 2021
d787ea2
CI: Set DEBIAN_FRONTEND variable and remove duplicate step
ruester Nov 19, 2021
67d423f
Merge branch 'ci-fixes' into 'master'
gfzriesgos-bot Dec 6, 2021
d4476eb
Add new valparaiso exposure models
gfzriesgos-bot Jan 31, 2022
0f79f50
Merge branch '3-include-3-new-valp-models' into 'master'
gfzriesgos-bot Jan 31, 2022
aade66e
CI: Fix installation of pip packages + black long lines
ruester Jan 19, 2022
99a9844
Fix image name in metadata
ruester Jan 19, 2022
7f6bf4f
CI: Include versions in process description
ruester Jan 24, 2022
52b161d
Fix installation of dependencies
ruester Feb 22, 2022
8b437ca
CI: Add trigger for deployment of latest docker image
ruester Mar 28, 2022
b57b099
Not sure where this Lima exposure model comes from
nbrinckm Apr 1, 2022
757d13e
But I delete it
nbrinckm Apr 1, 2022
d1c8c65
Converted the lima cvt4 model to epsg:4326
nbrinckm Apr 1, 2022
310945c
Merge branch '4-fix-prjection-of-the-limacvt4_pd40_ti60_5000' into 'm…
gfzriesgos-bot Apr 5, 2022
828f732
Minify GeoJSON output
ruester Apr 19, 2022
28d8558
CI: Update version of black
ruester Apr 19, 2022
5840714
Add tests for data structure of the output
ruester Apr 19, 2022
91adf0c
Merge branch '6-remove-unnecessary-whitespace' into 'master'
gfzriesgos-bot Apr 19, 2022
c8228e3
Resolve "Remove ValpCVTSaraDownscaled exposure model"
gfzriesgos-bot Apr 21, 2022
c546225
Merge branch '5-remove-valpcvtsaradownscaled-exposure-model' into 'ma…
gfzriesgos-bot Apr 21, 2022
5542157
Add openbuildingmap exposure models for valparaiso
nbrinckm Oct 5, 2023
32d1a71
Merge branch 'add-openbuildingmap-exposure-models-for-valparaiso' int…
nbrinckm Oct 5, 2023
4e9c740
Cut on coastline
nbrinckm Oct 12, 2023
3d474c0
Merge branch '7-correct-costline-in-obm-models-for-valpa' into 'master'
nbrinckm Oct 12, 2023
6aa8648
Add shapefile output to allow WMS
nbrinckm Oct 24, 2023
d1c8c0e
Merge branch 'add-shapefile-for-possible-wms-output' into 'master'
nbrinckm Oct 24, 2023
a774820
Fixes a problem with transforming to a shapefile
gfzriesgos-bot Jan 8, 2024
f0f1b21
Merge branch 'fix-writing-to-shapefile' into 'master'
gfzriesgos-bot Jan 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ output/
.idea
.vscode
.ipynb_checkpoints
*.pyc
env
*.swp
149 changes: 149 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Copyright © 2021 Helmholtz Centre Potsdam GFZ German Research Centre for Geosciences, Potsdam, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

stages:
- test
- build
- deploy

variables:
# needed by click library for the tests
LC_ALL: "C.UTF-8"
LANG: "C.UTF-8"

cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- .pip

.install_requirements: &install_requirements
- DEBIAN_FRONTEND=noninteractive apt-get update && apt-get upgrade -y
- DEBIAN_FRONTEND=noninteractive apt-get install python3 git cython python3-pip libspatialindex-dev libgdal-dev -y
- pip3 install --cache-dir=.pip -r requirements.txt

verify_python:
image: ubuntu:18.04
stage: test
tags:
- group
before_script:
- *install_requirements
script:
- python3 -m compileall .

python_pycodestyle:
image: ubuntu:18.04
stage: test
# TODO: fix code to fit with PEP8 guidelines
allow_failure: true
tags:
- group
before_script:
- *install_requirements
- pip3 install --cache-dir=.pip pycodestyle
script:
- shopt -s globstar && pycodestyle {,**/}*.py

python_pylint:
image: ubuntu:18.04
stage: test
# TODO: fix code to get a better pylint rating
allow_failure: true
tags:
- group
before_script:
- *install_requirements
- pip3 install --cache-dir=.pip pylint
script:
- shopt -s globstar && pylint --fail-under=8 {,**/}*.py

python_black:
image: ubuntu:18.04
stage: test
tags:
- group
before_script:
- *install_requirements
- pip3 install --cache-dir=.pip black==22.3.0
script:
- black -l 79 --check .

run_tests:
image: ubuntu:18.04
stage: test
tags:
- group
before_script:
- *install_requirements
script:
- python3 test_cmd.py

verify_json:
stage: test
image: registry.gitlab.com/pipeline-components/jsonlint:0.12.0
cache: {}
script:
- |
find . -not -path './.git/*' -name '*.json' -type f -print0 |
parallel --will-cite -k -0 -n1 jsonlint -q

dockerbuild_latest:
image: docker/compose:1.29.2
stage: build
cache: {}
tags:
- group
script:
- docker build -t assetmaster:latest -f metadata/Dockerfile .

# push latest image to Docker Hub
- docker tag assetmaster:latest gfzriesgos/assetmaster:latest
- docker login -u ${DOCKERHUB_USER} -p ${DOCKERHUB_PASSWORD}
- docker push gfzriesgos/assetmaster:latest

# push latest image to GitLab Container Registry
- docker tag assetmaster:latest git.gfz-potsdam.de:5000/id2/riesgos/assetmaster:latest
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push git.gfz-potsdam.de:5000/id2/riesgos/assetmaster:latest

dockerbuild_tagged:
image: docker/compose:1.29.2
stage: build
cache: {}
tags:
- group
rules:
- if: $CI_COMMIT_TAG
script:
- sed -i -e "s@:latest@:${CI_COMMIT_TAG}@g" metadata/assetmaster.json
- docker build -t assetmaster:${CI_COMMIT_TAG} -f metadata/Dockerfile .

# push image to Docker Hub
- docker tag assetmaster:${CI_COMMIT_TAG} gfzriesgos/assetmaster:${CI_COMMIT_TAG}
- docker login -u ${DOCKERHUB_USER} -p ${DOCKERHUB_PASSWORD}
- docker push gfzriesgos/assetmaster:${CI_COMMIT_TAG}

# push image to GitLab Container Registry
- docker tag assetmaster:${CI_COMMIT_TAG} git.gfz-potsdam.de:5000/id2/riesgos/assetmaster:${CI_COMMIT_TAG}
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push git.gfz-potsdam.de:5000/id2/riesgos/assetmaster:${CI_COMMIT_TAG}

deploy_latest:
stage: deploy
variables:
DEPLOY_LATEST_IMAGES: "true"
trigger:
project: id2/riesgos/gfz-riesgos-wps-repository
branch: master
strategy: depend
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [2019] [GFZ Potsdam]
Copyright [2021] [Helmholtz Centre Potsdam GFZ German Research Centre for Geosciences]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Assetmaster

web service providing exposure models upon geographical query - RIESGOS project

This program reads an exposure model from a geopackage (.gpkg) file and provides a user with a portion of the model according to a bounding box provided (lonminm, lonmax, latmin, latmax), a query mode ("intersects" or "within").
A given exposure vulnerability schema can be queried (currently only the "SARA_v1.0" model for Chile is implemented)
A given set of assets can be specified (currently only "res" for residential buildings)

### Citation

Pittore, Massimiliano; Gomez-Zapata, Juan Camilo; Brinckmann, Nils; Rüster, Matthias (2021): Assetmaster and Modelprop: web services to serve building exposure models and fragility functions for physical vulnerability to natural-hazards. V. 1.0. GFZ Data Services. https://doi.org/10.5880/riesgos.2021.005

### example (command line)
python3.7 assetmaster.py -71.8 -71.4 -33.2 -33.0 SARA_v1.0 res intersects

Expand All @@ -17,3 +22,32 @@ python3.7 assetmaster.py -71.8 -71.4 -33.2 -33.0 SARA_v1.0 res intersects

### Process configuration
The .json file providing the basic process configuration is in the *metadata* folder

### How to add data for other countries

If you just want to provide data for other countries you can add gpkg files
in the schemas/`<your schema here>`/ folders.

At least for the gpkg folder there is no naming convention inside of this folders
anymore.

The current version for SARA and Chile is the `schemas/SARA_v1.0/SARA_v1.0_data.gpkg`.
You can replace this with a new file.

For adding the peru exposure model for peru you can just insert the gpkg file into
the `schemas/SARA_v1/` folder. But please make sure that the data there matches the very
same structure of the existing gpkg data.

### Copyright & License
Copyright © 2021 Helmholtz Centre Potsdam GFZ German Research Centre for Geosciences, Potsdam, Germany

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

### Project

Deus was developed in the scope of the RIESGOS project:
Multi-Risk Analysis and Information System Components for the Andes Region (https://www.riesgos.de/en)
7 changes: 7 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright © 2021 Helmholtz Centre Potsdam GFZ German Research Centre for Geosciences, Potsdam, Germany
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Binary file removed __pycache__/assetmaster.cpython-37.pyc
Binary file not shown.
Binary file removed __pycache__/expo_nrml.cpython-36.pyc
Binary file not shown.
Loading