logo

Crowdly

Browser

Add to Chrome

import geopandas as gpd def spatial_query(buildings_gdf, rivers_gdf, distance=...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

import geopandas as gpd

def spatial_query(buildings_gdf, rivers_gdf, distance=50):

    rivers_buffer = rivers_gdf.buffer(distance)

    

    rivers_buffer_union = gpd.GeoSeries(rivers_buffer).unary_union

    

    buildings_in_buffer = buildings_gdf[buildings_gdf.intersects(rivers_buffer_union)]

    

    return buildings_in_buffer

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.chnu.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome