O'Reilly logo

Python Geospatial Development - Second Edition by Erik Westra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exercises

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.

    Tip

    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.

    Tip

    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) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required