I am using Python and I have two Shapefiles. One is a grid with equal Polygons and the other one is a shapefile representing a water network. I would like to count the pipe length in each cell of this grid. I have tried an overlay method but it returns an empty dataframe whereas both shapefiles have the same CRS.
print("Maillage/canalisation intersection...")
gdf_intersection_maille_cana=gpd.overlay(gdf_maillage,gdf_cana_total,how='intersection')
print(gdf_intersection_maille_cana)
print("Maillage/canalisation intersection done ! ")The second step would be to count the length in each grid but I don't really how to proceed. Once I have counted, the objective is to create a new column in my gdf_maillage with the pipe length in each cell .