Smooth swash cropping polygon to remove invalid geometry

etta-drone
Dan Howe 6 years ago
parent a0b17c2397
commit dc8531462a

@ -350,8 +350,11 @@ def polygon_wave_runup(xyz_1m, direction, shp_name, set_check_value, distance_ch
#making the cropping shapefile #making the cropping shapefile
#print('making the crop polygon') #print('making the crop polygon')
# Simplify polygon to remove invalid geometry
geom = Polygon(for_shape).simplify(10)
# Export polygon as shapefile # 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.crs = {'init': 'epsg:283{}'.format(zone), 'no_defs': True}
df.to_file(shp_name, driver='ESRI Shapefile') df.to_file(shp_name, driver='ESRI Shapefile')

Loading…
Cancel
Save