Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Read .shp files
- b = gpd.read_file(fp + 'puchheim_buildings.shp')
- la = gpd.read_file(fp + 'puchheim_landuse.shp')
- #Small parts of the shape files
- la_g = la.groupby('fclass').get_group('residential')
- b_r = b[100:130] # here I know there is an intersection with the big polygon
- # Find the polygons inside big polygons
- inter = gpd.overlay(b_r, la_g, how='intersection')
- # Read .shp files
- b = gpd.read_file(fp + 'puchheim_buildings.shp')
- la = gpd.read_file(fp + 'puchheim_landuse.shp')
- # Find the polygons inside big polygons
- inter = b.within(la.loc[0, 'geometry'])
- # Find the polygons inside big polygons
- b_c = b.centroid
- inter = b_c.within(la.loc[0, 'geometry'])
- # Read .shp files
- b = gpd.read_file(fp + 'puchheim_buildings.shp')
- la = gpd.read_file(fp + 'puchheim_landuse.shp')
- # Find intersections
- inter = b.within(la.loc[0, 'geometry'])
- # Comparation
- for r in range(len(b))
- if inter[r] == True:
- b[r]['type'] = 'residential'
Add Comment
Please, Sign In to add comment