Session Ready
Exercise

Projecting a Point

In the previous chapter, we worked with the Eiffel Tower location. Again, we provided you the coordinates in a projected coordinate system, so you could, for example, calculate distances. Let's return to this iconic landmark, and express its location in geographical coordinates: 48°51′29.6″N, 2°17′40.2″E. Or, in decimals: latitude of 48.8584 and longitude of 2.2945.

Shapely geometry objects have no notion of a CRS, and thus cannot be directly converted to another CRS. Therefore, we are going to use the GeoPandas to transform the Eiffel Tower point location to an alternative CRS. We will put the single point in a GeoSeries, use the to_crs() method, and extract the point again.

GeoPandas is already imported.

Instructions
100 XP
  • Create a shapely point object with the coordinates of the Eiffel Tower and assign it to a variable called eiffel_tower.
  • Create a GeoSeries (called s_eiffel_tower) with the Eiffel Tower as the single element and specify the CRS to be EPSG:4326.
  • Convert s_eiffel_tower to EPSG:2154, and call the result s_eiffel_tower_projected