Guest User

Untitled

a guest
Jun 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. # Read .shp files
  2. b = gpd.read_file(fp + 'puchheim_buildings.shp')
  3. la = gpd.read_file(fp + 'puchheim_landuse.shp')
  4.  
  5. #Small parts of the shape files
  6. la_g = la.groupby('fclass').get_group('residential')
  7. b_r = b[100:130] # here I know there is an intersection with the big polygon
  8.  
  9. # Find the polygons inside big polygons
  10. inter = gpd.overlay(b_r, la_g, how='intersection')
  11.  
  12. # Read .shp files
  13. b = gpd.read_file(fp + 'puchheim_buildings.shp')
  14. la = gpd.read_file(fp + 'puchheim_landuse.shp')
  15.  
  16. # Find the polygons inside big polygons
  17. inter = b.within(la.loc[0, 'geometry'])
  18.  
  19. # Find the polygons inside big polygons
  20. b_c = b.centroid
  21. inter = b_c.within(la.loc[0, 'geometry'])
  22.  
  23. # Read .shp files
  24. b = gpd.read_file(fp + 'puchheim_buildings.shp')
  25. la = gpd.read_file(fp + 'puchheim_landuse.shp')
  26.  
  27. # Find intersections
  28. inter = b.within(la.loc[0, 'geometry'])
  29.  
  30. # Comparation
  31. for r in range(len(b))
  32. if inter[r] == True:
  33. b[r]['type'] = 'residential'
Add Comment
Please, Sign In to add comment