...
/Solution: Aggregation and Constructive Methods
Solution: Aggregation and Constructive Methods
Practice the concepts of aggregation and constructive methods with real datasets.
We'll cover the following...
Solution: Shore islands
Let's review the code solution:
Press + to interact
import geopandas as gpd# open the datasetsislands = gpd.read_file('minor_islands.geojson')countries = gpd.read_file('countries.geojson')# create the continents boundariescontinents = countries.dissolve(by='continent')# select the African continentafrica = continents.loc[['Africa']]# create a buffer distant 150km from the africa boundarieslimits = africa.buffer(1.5)# get the islands inside the limitsshore_islands = islands.clip(limits)# display the resultsax = continents.loc[['Africa']].plot()limits.plot(ax=ax, facecolor='none', edgecolor='grey')shore_islands.plot(ax=ax, edgecolor='red', linewidth=3)ax.set_ylabel('Latitude (degrees)')ax.set_xlabel('Longitude (degrees)')ax.figure.savefig('output/shore_islands.png', dpi=300)
To identify the islands that are within a given distance from Africa, we first need a polygon ...
Access this course and 1400+ top-rated courses and projects.