Session Ready
Exercise

Shapely's spatial methods

Now we have a shapely Point object for the Eiffel Tower, we can use the different methods available on such a geometry object to perform spatial operations, such as calculating a distance or checking a spatial relationship.

We repeated the construction of eiffel_tower, and also provide the code that extracts one of the neighbourhoods (the Montparnasse district), as well as one of the restaurants located within Paris.

Instructions
100 XP
  • Check if the Eiffel Tower is located within the Montparnasse district.
  • Check if the Montparnasse district contains the restaurant location.
  • Calculate the distance between the Eiffel Tower and the restaurant (note: in this case, the distance is returned in meters).