From cbb2f839d457054c51525f95facf77f58ac47df4 Mon Sep 17 00:00:00 2001 From: Markus Konrad Date: Thu, 28 Jan 2021 14:04:19 +0100 Subject: [PATCH] make separate geom handling optional --- examples/using_geopandas.png | Bin 44065 -> 44127 bytes examples/using_geopandas.py | 4 +++- geovoronoi/_voronoi.py | 13 +++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/using_geopandas.png b/examples/using_geopandas.png index 7f6dd3836c67ae7e5cc1f1d5a1374768305eadad..ccba835892d21c46d20dc31fbd1136c196b1ad00 100644 GIT binary patch delta 10294 zcma)hby!vHw=D>WBH;!>kdjTebceDDkr0rMO?P)M_yF0oNK1zxAqYr!H%KVm-6g$& zyY_dUbANx_^W5jGf7iR-^~M}yjyY!b)Pu#T2S0*>0oJ#V-aewCd)@v5a~czd!^HBz zOeH+)8xm8uide^n*!F9pP7O=-K~8P<%a;hY3fk0gHf__#J`ZSU0{3R=cusFXyhYdQtlq)fcnjIxT2L zQnXXRJd=0x5!1acrYd2Q>*(Qa7vBxyQHjs_k7-lm_YF+YAV1D)PYKh?=}XT8ij(TH zm63Ow@Ch!K@BF2gJ@R+Xe!2&>6~t&>^y)~LZF|5RnLj|^#|+IFSo?M;9EAvFWoD+~ z<&9riF@E#rO=Pso+j)L(UOSJ&<(kzV6EXM5&mm7nE^ioW7Q!`6O@lTCsp5KfejOgJ zSANhmK0WIx&WU8ryd{Dw`G5J6_3p;ue&#uL@>E%=ET_QsY;1L#NLh}N~;hz@J4*0s&huWyM8Oqnl)T{gb2V&Bso!SKy>@vzG%z4`_g zW3+AdFTH=ychs^L1jnua)^pR=KfXQMW&7v~gwu2`rq1`gn@Z6So?m{+!4}|e2W2iS zF>=zukA2;|miR$MJ$__ad2wYm<-ScKn{{$zDqzTdvuFUCBAiF*j*WCWP~vu$|Bo|ePX$i|RSTS!Z3B6Y>f7fM#leO#Sv1tDooU9IQaYWa%b#b*hCQtccq zcf9`uT;EAlW>RN&gsRnL_$(opeJmZ2l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qp5ps5oP6AMZNAcqAf4s4=2K1|q(3=Izx-M9hzCLNO^qOirjB04oy0|;t?#1CJi sJ1GA5OPn5nUjF~?^mhM0z5BWB?<%V3r0OSqIN+lsuZ}2uZ2b9u03^BlZ2$lO diff --git a/examples/using_geopandas.py b/examples/using_geopandas.py index 2fea3fa..a4af697 100644 --- a/examples/using_geopandas.py +++ b/examples/using_geopandas.py @@ -47,7 +47,9 @@ coords = points_to_coords(south_am_cities.geometry) # calculate the regions -poly_shapes, poly_to_pt_assignments = voronoi_regions_from_coords(coords, south_am_shape) +# we set "per_geom=False" so that the whole continent is treated as one area and Voronoi regions +# span over to Tierra del Fuego +poly_shapes, poly_to_pt_assignments = voronoi_regions_from_coords(coords, south_am_shape, per_geom=False) #%% diff --git a/geovoronoi/_voronoi.py b/geovoronoi/_voronoi.py index 6e6d816..6ba14a7 100644 --- a/geovoronoi/_voronoi.py +++ b/geovoronoi/_voronoi.py @@ -32,7 +32,7 @@ def points_to_coords(pts): return np.array([p.coords[0] for p in pts]) -def voronoi_regions_from_coords(coords, geo_shape): +def voronoi_regions_from_coords(coords, geo_shape, per_geom=True): """ Calculate Voronoi regions from NumPy array of 2D coordinates `coord` that lie within a shape `geo_shape`. Setting `shapes_from_diff_with_min_area` fixes rare errors where the Voronoi shapes do not fully cover `geo_shape`. Set this @@ -57,7 +57,7 @@ def voronoi_regions_from_coords(coords, geo_shape): doesn't intersect with `geo_shape`. """ - logger.info('running Voronoi tesselation for %d points' % len(coords)) + logger.info('running Voronoi tesselation for %d points / treating geoms separately: %s' % (len(coords), per_geom)) if isinstance(coords, np.ndarray): pts = coords_to_points(coords) @@ -65,12 +65,13 @@ def voronoi_regions_from_coords(coords, geo_shape): pts = coords coords = points_to_coords(pts) - if isinstance(geo_shape, Polygon): + if not isinstance(geo_shape, (Polygon, MultiPolygon)): + raise ValueError('`geo_shape` must be a Polygon or MultiPolygon') + + if not per_geom or isinstance(geo_shape, Polygon): geoms = [geo_shape] - elif isinstance(geo_shape, MultiPolygon): + else: # Multipolygon geoms = geo_shape.geoms - else: - raise ValueError('`geo_shape` must be a Polygon or MultiPolygon') pts_indices = set(range(len(pts))) region_polys = {}