-
Book Overview & Buying
-
Table Of Contents
Python Geospatial Development - Second Edition - Second Edition
By :
If you are interested in exploring the techniques used in this chapter further, you might like to challenge yourself with the following tasks:
Change the "Calculate Bounding Box" calculation to exclude outlying islands.
Hint
You can split each country's MultiPolygon into individual Polygon objects, and then check the area of each polygon to exclude those which are smaller than a given total value.
Use the World Borders Dataset to create a new shapefile, where each country is represented by a single "Point" geometry containing the geographical center of each country.
Hint
You can start with the country bounding boxes we calculated earlier, and then calculate the midpoint using:
midLat = (minLat + maxLat) / 2 midLong = (minLong + maxLong) / 2
For an extra challenge, you could use Shapely's centroid() method to calculate a more accurate representation of each country's center. To do this, you would have to convert the country's outline into a Shapely geometry, calculate the centroid...
Change the font size
Change margin width
Change background colour