Commit 11329361 authored by Dumoulin Nicolas's avatar Dumoulin Nicolas
Browse files

target surface of each culture given by the PAT are now stored in file

parent 0d9692c0
cultgeopat;2016;2050
Céréales;39.1578162680355;42.4510757826923
Prairies;83.9947787550856;76.3917619047619
Oléagineux;4.02651841988345;4.36515758215069
Fourrages;26.7457940864208;15.4649021294656
Fruits et légumes;0.35475779373955496;3.97664751692735
Cultures industrielles;2.31418094174966;2.52551689693261
Protéagineux;0.704985252201107;8.59885297148308
...@@ -5,7 +5,8 @@ class Proximite: ...@@ -5,7 +5,8 @@ class Proximite:
''' '''
Function calculating the proximity indice. Function calculating the proximity indice.
The purpose of this indice is to reflect the proximity between productions site and consommation site. The purpose of this indice is to reflect the proximity between productions site and consommation site.
We are calculating it with a comparison of the area of patches cultivating fruits and vegetables and the population of living area (bassin de vie) in the PAT's territory We are calculating it with a comparison of the area of patches cultivating fruits and vegetables
and the population of living area (bassin de vie) in the PAT's territory
A living area with a low population will require a lower cultivating area to get a good value. A living area with a low population will require a lower cultivating area to get a good value.
''' '''
...@@ -31,6 +32,11 @@ class Proximite: ...@@ -31,6 +32,11 @@ class Proximite:
if __name__ == '__main__': if __name__ == '__main__':
import geopandas as gpd import geopandas as gpd
import pandas as pd
patches = gpd.GeoDataFrame.from_file("../output/PAT_patches/PAT_patches.shp", encoding='utf-8') patches = gpd.GeoDataFrame.from_file("../output/PAT_patches/PAT_patches.shp", encoding='utf-8')
prox = Proximite(patches, 20165939.605135553) patches = patches[patches['cultgeopat']!='Non Considérée']
target = pd.read_csv('../resources/targetPAT.csv', sep=';',index_col=0)
targetRatio = (target['2050']-target['2016'])/target['2016']
targetPAT = patches.groupby('cultgeopat')['SURF_PARC'].sum()*(1+targetRatio)
prox = Proximite(patches, targetPAT['Fruits et légumes'])
print(prox.compute_indicator(patches, True)) print(prox.compute_indicator(patches, True))
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