Skip to content

Commit

Permalink
Fix normal conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
davide-f committed Jan 22, 2023
1 parent 19fb9e2 commit 2d2dced
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/build_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def filter_gadm(
f"Contended areas have been found for gadm layer {layer}. They will be dropped according to {contended_flag} option"
)

# NOTE: in these options GID_0 is not changed because it is modified below
if contended_flag == "drop":
geodf.drop(geodf_non_std.index, inplace=True)
geodf["GID_0"] = cc
else:
# this is the "set_by_country" option that is also the fallback for unexpected values
if contended_flag != "set_by_country":
Expand All @@ -109,8 +109,8 @@ def filter_gadm(
+ "Fallback to 'set_by_country'"
)

# in case GID_0 have any exotic values, "COUNTRY" column may be used instead
geodf["GID_0"] = cc
# force GID_0 to be the country code for the relevant countries
geodf["GID_0"] = cc

# country shape should have a single geomerty
if (layer == 0) and (geodf.shape[0] > 1):
Expand Down

0 comments on commit 2d2dced

Please sign in to comment.