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
202e8d93
Commit
202e8d93
authored
Apr 11, 2019
by
Dumoulin Nicolas
Browse files
syntax fix
parent
11329361
Changes
1
Hide whitespace changes
Inline
Side-by-side
scenariosAleatoires/resilience_list.py
View file @
202e8d93
...
...
@@ -4,7 +4,7 @@ import geopandas as gpd
import
math
class
Resilience
:
def
__init__
(
self
,
grille
):
def
__init__
(
self
,
grille
,
initial_patches
):
'''
Initialize the indicator.
...
...
@@ -13,7 +13,7 @@ class Resilience:
self
.
grid
=
gpd
.
GeoDataFrame
.
from_file
(
grille
)
intersection
=
gpd
.
sjoin
(
self
.
grid
[[
'id'
,
'geometry'
]],
patches
[[
'geometry'
,
'SURF_PARC'
]],
initial_
patches
[[
'geometry'
,
'SURF_PARC'
]],
how
=
'inner'
,
op
=
'intersects'
)
self
.
grouped_by_cell
=
intersection
.
groupby
(
'id'
)
self
.
size
=
len
(
self
.
grouped_by_cell
)
...
...
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