I have a shapefile which has multipolygon geometries. I want to generate random points inside them using GeoPandas. I tried with the below code but it's not giving geodataframe of points.
df = gpd.read_file(multipolygonshp) geom= df['geometry'] final_geom = geom.unary_union x_min, y_min, x_max, y_max = final_geom.bounds n = 3000 x = np.random.uniform(x_min, x_max, n) y = np.random.uniform(y_min, y_max, n) gdf_points = gpd.GeoSeries(gpd.points_from_xy(x, y)) gdf_points = gpd.GeoSeries(gdf_points.within(final_geom.unary_union)) <ipython-input-125-ed976bd8ef24>:23: FutureWarning: You are passing non-geometry data to the GeoSeries constructor. Currently, it falls back to returning a pandas Series. But in the future, we will start to raise a TypeError instead. gdf_points = gpd.GeoSeries(gdf_points.within(final_geom))