diff --git a/las_manipulation.py b/las_manipulation.py index 9a44b67..7fc5357 100644 --- a/las_manipulation.py +++ b/las_manipulation.py @@ -350,8 +350,11 @@ def polygon_wave_runup(xyz_1m, direction, shp_name, set_check_value, distance_ch #making the cropping shapefile #print('making the crop polygon') + # Simplify polygon to remove invalid geometry + geom = Polygon(for_shape).simplify(10) + # Export polygon as shapefile - df = gpd.GeoDataFrame(geometry=[Polygon(for_shape)]) + df = gpd.GeoDataFrame(geometry=[geom]) df.crs = {'init': 'epsg:283{}'.format(zone), 'no_defs': True} df.to_file(shp_name, driver='ESRI Shapefile')