Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pradh committed Sep 14, 2023
1 parent 0064052 commit 94d79cf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/un/boundaries/country_boundaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
'southamerica': 10,
}


#
# Code from @chejennifer.
#
Expand Down Expand Up @@ -199,9 +200,10 @@ def extract_country_geojson(self, all_countries_df, existing_codes):
print(f'Exporting geojson to {self.output_dir}')
col = 'iso3cd'
for country_code in existing_codes:
country_data = all_countries_df[(all_countries_df[col] == country_code) &
(all_countries_df['geometry'].geom_type != 'LineString') &
(all_countries_df['geometry'].geom_type != 'MultiLineString')]
country_data = all_countries_df[
(all_countries_df[col] == country_code) &
(all_countries_df['geometry'].geom_type != 'LineString') &
(all_countries_df['geometry'].geom_type != 'MultiLineString')]
country_data = country_data.dissolve(
by=col) # Join multiple rows into a single shape
self._simplify_json(country_code, country_data)
Expand Down Expand Up @@ -233,7 +235,8 @@ def build_cache(self, existing_codes):
print(f'Missing geojson for {child}')
continue
geo = self._geojson(code, dp_level)
feature = get_geojson_feature(child, child2name.get(child, ''), geo)
feature = get_geojson_feature(child, child2name.get(child, ''),
geo)
if feature:
features.append(feature)
result = {
Expand Down

0 comments on commit 94d79cf

Please sign in to comment.