Skip to main content
added 8 characters in body
Source Link
Kadir Şahbaz
  • 78k
  • 57
  • 257
  • 404

There are two mistakes in your script.

  1. Since intersect_ls is a list, use extend instead of append. The reason of getting error is that. Because the first item in fin_ls is a geometry, the other is a list, but it should have been a geometry too.

     fin_ls.append(differ)
     fin_ls.extend(intersec_ls)
    
  2. Since gdf is a GeoDataFrame instance, you cannot use parenthesis with gdf as in gdf( geometry= geom). Instead, use

     gdf = gpd.GeoDataFrame(gdf, geometry=geom) 
    

Or just use gdf = gpd.GeoDataFrame(geometry=geom) if you didn't define gdf before. In this case gdf includes only geometries.

There are two mistakes in your script.

  1. Since intersect_ls is a list, use extend instead of append. The reason of getting error is that. Because the first item in fin_ls is a geometry, the other is a list, but it should have been a geometry too.

     fin_ls.append(differ)
     fin_ls.extend(intersec_ls)
    
  2. Since gdf is a GeoDataFrame, you cannot use parenthesis with gdf as in gdf( geometry= geom). Instead, use

     gdf = gpd.GeoDataFrame(gdf, geometry=geom) 
    

Or just use gdf = gpd.GeoDataFrame(geometry=geom) if you didn't define gdf before. In this case gdf includes only geometries.

There are two mistakes in your script.

  1. Since intersect_ls is a list, use extend instead of append. The reason of getting error is that. Because the first item in fin_ls is a geometry, the other is a list, but it should have been a geometry too.

     fin_ls.append(differ)
     fin_ls.extend(intersec_ls)
    
  2. Since gdf is a GeoDataFrame instance, you cannot use parenthesis with gdf as in gdf( geometry= geom). Instead, use

     gdf = gpd.GeoDataFrame(gdf, geometry=geom) 
    

Or just use gdf = gpd.GeoDataFrame(geometry=geom) if you didn't define gdf before. In this case gdf includes only geometries.

edited body
Source Link
Kadir Şahbaz
  • 78k
  • 57
  • 257
  • 404

There are two mistakes in your script.

  1. Since intersect_ls is a list, use extend instead of append. The reason of getting error is that. Because one of the element offirst item in fin_ls is a geometry, the other is a list, but it should have been a geometry too.

     fin_ls.append(differ)
     fin_ls.extend(intersec_ls)
    
  2. Since gdf is a GeoDataFrame, you cannot use parenthesis with gdf as in gdf( geometry= geom). Instead, use

     gdf = gpd.GeoDataFrame(gdf, geometry=geom) 
    

Or just use gdf = gpd.GeoDataFrame(geometry=geom) if you didn't define gdf before. In this case gdf includes only geometries.

There are two mistakes in your script.

  1. Since intersect_ls is a list, use extend instead of append. The reason of getting error is that. Because one of the element of fin_ls is a geometry, the other is a list, but it should have been a geometry.

     fin_ls.append(differ)
     fin_ls.extend(intersec_ls)
    
  2. Since gdf is a GeoDataFrame, you cannot use parenthesis with gdf as in gdf( geometry= geom). Instead, use

     gdf = gpd.GeoDataFrame(gdf, geometry=geom) 
    

Or just use gdf = gpd.GeoDataFrame(geometry=geom) if you didn't define gdf before. In this case gdf includes only geometries.

There are two mistakes in your script.

  1. Since intersect_ls is a list, use extend instead of append. The reason of getting error is that. Because the first item in fin_ls is a geometry, the other is a list, but it should have been a geometry too.

     fin_ls.append(differ)
     fin_ls.extend(intersec_ls)
    
  2. Since gdf is a GeoDataFrame, you cannot use parenthesis with gdf as in gdf( geometry= geom). Instead, use

     gdf = gpd.GeoDataFrame(gdf, geometry=geom) 
    

Or just use gdf = gpd.GeoDataFrame(geometry=geom) if you didn't define gdf before. In this case gdf includes only geometries.

added 148 characters in body
Source Link
Kadir Şahbaz
  • 78k
  • 57
  • 257
  • 404

There are two mistakes in your script.

  1. Since intersect_ls is a list, use extend instead of append. The reason of getting error is that. Because one of the element of fin_ls is a geometry, the other is a list, but it should have been a geometry.

     fin_ls.append(differ)
     fin_ls.extend(intersec_ls)
    
  2. Since gdf is a GeoDataFrame, you cannot use parenthesis with gdf as in gdf( geometry= geom). Instead, use

     gdf = gpd.GeoDataFrame(gdf, geometry=geom) 
    

Or just use gdf = gpd.GeoDataFrame(geometry=geom) if you didn't define gdf before. In this case gdf includes only geometries.

There are two mistakes in your script.

  1. Since intersect_ls is a list, use extend instead of append.

     fin_ls.append(differ)
     fin_ls.extend(intersec_ls)
    
  2. Since gdf is a GeoDataFrame, you cannot use parenthesis with gdf as in gdf( geometry= geom). Instead, use

     gdf = gpd.GeoDataFrame(gdf, geometry=geom) 
    

Or just use gdf = gpd.GeoDataFrame(geometry=geom) if you didn't define gdf before. In this case gdf includes only geometries.

There are two mistakes in your script.

  1. Since intersect_ls is a list, use extend instead of append. The reason of getting error is that. Because one of the element of fin_ls is a geometry, the other is a list, but it should have been a geometry.

     fin_ls.append(differ)
     fin_ls.extend(intersec_ls)
    
  2. Since gdf is a GeoDataFrame, you cannot use parenthesis with gdf as in gdf( geometry= geom). Instead, use

     gdf = gpd.GeoDataFrame(gdf, geometry=geom) 
    

Or just use gdf = gpd.GeoDataFrame(geometry=geom) if you didn't define gdf before. In this case gdf includes only geometries.

Source Link
Kadir Şahbaz
  • 78k
  • 57
  • 257
  • 404
Loading