The UFZ services GitLab and Mattermost will be unavailable on Monday, July 4 from 06:00 AM to 08:00 AM due to maintenance work.

Commit 8e8152c0 authored by Adam Reichold's avatar Adam Reichold
Browse files

Add weights for EUNIS types based on French flower survey.

parent 43ecc5f9
......@@ -6,6 +6,28 @@ from osgeo import gdal, ogr
WIDTH, HEIGHT, LENGTH = 10000, 10000, 1000
# based on the number of inflorescences per habitat type
# from the VOODOO flower survey, 2021 in France
WEIGHTS = {
"I1.5": 0.021535,
"G1.A": 0.064231,
"G1.C": 0.032061,
"G5.7": 0.008234,
"FA.2": 0.010197,
"I1.1": 0.189130,
"E2.2": 0.038091,
"E3.4": 0.003717,
"E2.6": 0.222857,
"J4.6": 0.004463,
"C2.3": 0.004967,
"X07": 0.071128,
"I2.2": 0.321364,
"FA.3": 0.003607,
"F3.1": 0.002357,
"C2.5": 0.000515,
"FB.4": 0.001546,
}
data = gdal.OpenEx(sys.argv[1], gdal.OF_VECTOR)
layer = data.GetLayer()
......@@ -26,8 +48,8 @@ for feature in temp_layer:
weight = 0.0
# https://eunis.eea.europa.eu/habitats.jsp
if eunis and eunis.startswith("I"):
weight = 1.0
if eunis and eunis in WEIGHTS:
weight = WEIGHTS[eunis]
feature.SetField("Weight", weight)
temp_layer.SetFeature(feature)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment