build_shapes: default to no tolerance in polygon simplification (#1137)
This commit is contained in:
parent
31753143f5
commit
b6d11bba6f
@ -10,6 +10,8 @@ Release Notes
|
||||
Upcoming Release
|
||||
================
|
||||
|
||||
* In simplifying polygons in :mod:`build_shapes` default to no tolerance.
|
||||
|
||||
* Set non-zero capital_cost for methanol stores to avoid unrealistic storage sizes
|
||||
|
||||
* Set p_nom = p_nom_min for generators with baseyear == grouping_year in add_existing_baseyear. This has no effect on the optimization but helps n.statistics to correctly report already installed capacities.
|
||||
|
@ -91,7 +91,7 @@ def _get_country(target, **keys):
|
||||
return np.nan
|
||||
|
||||
|
||||
def _simplify_polys(polys, minarea=0.1, tolerance=0.01, filterremote=True):
|
||||
def _simplify_polys(polys, minarea=0.1, tolerance=None, filterremote=True):
|
||||
if isinstance(polys, MultiPolygon):
|
||||
polys = sorted(polys.geoms, key=attrgetter("area"), reverse=True)
|
||||
mainpoly = polys[0]
|
||||
@ -106,7 +106,9 @@ def _simplify_polys(polys, minarea=0.1, tolerance=0.01, filterremote=True):
|
||||
)
|
||||
else:
|
||||
polys = mainpoly
|
||||
return polys.simplify(tolerance=tolerance)
|
||||
if tolerance is not None:
|
||||
polys = polys.simplify(tolerance=tolerance)
|
||||
return polys
|
||||
|
||||
|
||||
def countries(naturalearth, country_list):
|
||||
|
Loading…
Reference in New Issue
Block a user