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

joining with cultures classification of GéoPAT

parent 0b6de03d
......@@ -51,8 +51,13 @@ def build_initial_PAT(rpg_parcelles_filename, rpg_ilots_filename, pat_cultural_c
patches_expl = patches_expl.fillna(-1)
patches_expl['id_ilot'] = patches_expl['id_ilot'].astype(int)
patches_expl['id_expl'] = patches_expl['id_expl'].astype(int)
# cultural code joining
codes = pd.read_csv(pat_cultural_classes_filename)
patches_expl = patches_expl.merge(codes[['category','Classe GéoPAT']],how='left',left_on='CODE_CULTU',right_on='category')
patches_expl = patches_expl.rename(columns={'Classe GéoPAT':'cultgeopat'})
# TODO join with MAJIC
return [patches,rpg_ilots,patches_expl]
return [municipalities,patches,rpg_ilots,patches_expl]
def build_PAT_municipalities(pat_municipalities_dir, bdv_filename, bdv_fixes_filename,
adminexpress_com_filename, adminexpress_epci_filename):
......@@ -92,7 +97,7 @@ if __name__ == '__main__':
resources={}
for k,v in yaml.load(open('resources/INDEX.yml','r')).items():
resources[v['variable']] = 'resources/'+v['file'] if 'file' in v else k
patches,rpg_ilots,patches_expl = build_initial_PAT(resources['rpg_parcelles_filename'], resources['rpg_ilots_filename'],
municipalities,patches,rpg_ilots,patches_expl = build_initial_PAT(resources['rpg_parcelles_filename'], resources['rpg_ilots_filename'],
resources['pat_cultural_classes_filename'],
resources['majic_filename'],
resources['pat_municipalities_dir'],
......
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