Polar Stereographic Projection Of Geopandas World Map
Solution 1:
When plotting with a specific cartopy projection, it is best to actually create the matplotlib figure and axes using cartopy, to make sure it is aware of the projection (in technical terms: to make sure it is a GeoAxes, see https://scitools.org.uk/cartopy/docs/latest/matplotlib/intro.html):
crs = ccrs.SouthPolarStereo()
crs_proj4 = crs.proj4_initw= world.to_crs(crs_proj4)
fig, ax = plt.subplots(subplot_kw=dict(projection=crs))
w.plot(ax=ax, facecolor='sandybrown', edgecolor='black')
However, this still seems to plot the shapes that fall outside of the extent. Using the cartopy add_geometries method, this better respects the extent:
fig, ax = plt.subplots(subplot_kw=dict(projection=crs))
ax.add_geometries(w['geometry'], crs=crs, facecolor='sandybrown', edgecolor='black')
This looks a bit strange at first sight (Antartica in the middle is very small), but this seems to be expected (see https://scitools.org.uk/cartopy/docs/latest/crs/projections.html#southpolarstereo).
In general, see the example on combining GeoPandas and cartopy in the docs: https://geopandas.readthedocs.io/en/latest/gallery/cartopy_convert.html

Post a Comment for "Polar Stereographic Projection Of Geopandas World Map"