CommencerCommencer gratuitement

Changing coordinate reference systems

In this exercise you will learn how to find a GeoDataFrame's coordinate reference system and how to change it. The school districts GeoDataFrame is available as school_districts.

Cet exercice fait partie du cours

Visualizing Geospatial Data in Python

Afficher le cours

Instructions

  • Print the first row of school_districts and the crs property of this GeoDataFrame.
  • Convert the coordinate reference system of school_districts to epsg:3857.
  • Print the crs property again to confirm that it was changed.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Print the first row of school districts GeoDataFrame and the crs
print(____.head(1))
print(____.crs)

# Convert the crs to epsg:3857
school_districts.geometry = school_districts.geometry.____(epsg = 3857)
                        
# Print the first row of school districts GeoDataFrame and the crs again
print(school_districts.head(1))
print(____.____)
Modifier et exécuter le code