Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
geopat
geopat
Commits
26065602
Commit
26065602
authored
Mar 15, 2019
by
Dumoulin Nicolas
Browse files
joining with cultures classification of GéoPAT
parent
0b6de03d
Changes
1
Hide whitespace changes
Inline
Side-by-side
PATBuilder.py
View file @
26065602
...
...
@@ -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'
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment