I have two shapefiles: Boundary.shp and Lines.shp. I want to clip the lines inside one boundary polygon.
import geopandas as gpd fn_boundary = "D\Boundary.shp" fn_aerial = "D\Lines.shp" df_boundary = gpd.read_file(fn_boundary)['geometry'] df_boundary_list = df_boundary.tolist() x = df_boundary_list df_aerial = gpd.read_file(fn_aerial) poly_gdf = gpd.GeoDataFrame(, geometry=[x], crs=df_aerial.crs) df_aerial_clipped = gpd.clip(df_aerial,poly_gdf) **>>> print(df_aerial_clipped) Empty GeoDataFrame Columns: [Length, Placement, geometry] Index: **
Why does it return an empty data frame? This code works fine for another set of shape files. But for these two shape files, it is returning an empty data frame. What is the issue with the shape files? Or is there any mistake in the code??
I have uploaded both the shape files at this link.