Commit 0efc91e9 authored by Bruno Duyé's avatar Bruno Duyé
Browse files

OMI score - add color column correcponding to score

parent c55fcc38
......@@ -1823,33 +1823,44 @@
" # Calcul du périmètre du cycle\n",
" cycle_perimeter = cycle_shape.length\n",
" # Calcul du score OMI\n",
" score = None\n",
" score = color = None\n",
" if cycle_densite < 100:\n",
" score = 1\n",
" color = 'white'\n",
" if cycle_densite >= 100 and cycle_densite < 1000 and cycle_perimeter < 350:\n",
" score = 2\n",
" color = '#4AFF40' # Vert clair\n",
" if cycle_densite >= 100 and cycle_densite < 1000 and cycle_perimeter >= 350 and cycle_perimeter < 700:\n",
" score = 3\n",
" color = '#FFFF7B' # jauneclair\n",
" if cycle_densite >= 100 and cycle_densite < 1000 and cycle_perimeter >= 700:\n",
" score = 4\n",
" color = '#FFA295' # rougeclair\n",
" if cycle_densite >= 1000 and cycle_densite < 10000 and cycle_perimeter < 350:\n",
" score = 5\n",
" color = '#078C00' # vertmoyen\n",
" if cycle_densite >= 1000 and cycle_densite < 10000 and cycle_perimeter >= 350 and cycle_perimeter < 700:\n",
" score = 6\n",
" color = '#E3E73B' # jaunemoyen\n",
" if cycle_densite >= 1000 and cycle_densite < 10000 and cycle_perimeter >= 700:\n",
" score = 7\n",
" color = '#E7503B' # rougemoyen\n",
" if cycle_densite >= 10000 and cycle_perimeter < 350:\n",
" score = 8\n",
" color = '#05A000' # vertfort\n",
" if cycle_densite >= 10000 and cycle_perimeter >= 350 and cycle_perimeter < 700:\n",
" score = 9\n",
" color = '#EEFF00' # jaunefort\n",
" if cycle_densite >= 10000 and cycle_perimeter >= 700:\n",
" score = 10\n",
" color = 'red'\n",
" assert score, f\"No score found for densite={cycle_densite} and perimeter={cycle_perimeter}\"\n",
" #print(f\"Score: {score}\")\n",
" # Ajout de ce score dans la liste scores\n",
" scores.append({\n",
" 'geometry': cycle_gdf.geometry.iloc[0],\n",
" 'score': score\n",
" 'score': score,\n",
" 'color': color\n",
" })\n",
" i+=1\n",
" #if i==50:\n",
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