Projecting a GeoDataFrame
The Paris districts dataset is provided in geographical coordinates (longitude/latitude in WGS84). To see the result of naively using the data as is for plotting or doing calculations, we will first plot the data as is, and then plot a projected version.
The standard projected CRS for France is the RGF93 / Lambert-93 reference system (referenced by the EPSG:2154 number).
GeoPandas and matplotlib have already been imported, and the districts dataset is read and assigned to the districts variable.
Este exercício faz parte do curso
Working with Geospatial Data in Python
Instruções do exercício
- Print the CRS of the
districtsdataset. - Make a simple plot of the
districtsdataset. - Convert the
districtsto a projected CRS (using theEPSG:2154for France). Call the new datasetdistricts_RGF93. - Make a similar plot of
districts_RGF93.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Print the CRS information
print(____)
# Plot the districts dataset
____
plt.show()
# Convert the districts to the RGF93 reference system
districts_RGF93 = districts.____
# Plot the districts dataset again
districts_RGF93.____
plt.show()