Overlay of two polygon layers
Going back to the land use and districts datasets, we will now combine both datasets in an overlay operation. Create a new GeoDataFrame consisting of the intersection of the land use polygons with each of the districts, but make sure to bring the attribute data from both source layers.
GeoPandas is already imported.
Это упражнение является частью курса
Working with Geospatial Data in Python
Инструкции к упражнению
- Print the first rows of both datasets (
land_useanddistricts). - Create a new GeoDataFrame from the intersections of
land_useanddistricts. Assign the result to a variablecombined. - Print the first rows the resulting GeoDataFrame (
combined).
Интерактивное практическое упражнение
Попробуйте выполнить это упражнение, дополнив этот пример кода.
# Print the first five rows of both datasets
print(____)
print(____)
# Overlay both datasets based on the intersection
combined = geopandas.____(____, ____, how='____')
# Print the first five rows of the result
print(____)