Issue
Longitude and latitude scale next to axes are not correct in a Mercator map created with geopandas (Python3).
I made a Mercator-projecrioned map with geopandas like this.
import geopandas as gpd
import matplotlib.pyplot as plt
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
world = world[(world.name != "Antarctica") & (world.name != "Fr. S. Antarctic Lands")]
world = world.to_crs("EPSG:3395")
ax = world.plot()
ax.set_title("Mercator")
plt.show()
The map itself was correctly output, but longitude/latitude scales next to axes were incorrect as in images below.
Longitude is supposed to range -180 to 180, and latitude -90 to 90. However, scales in the image don't do so.
How could I get correctly output scales?
Solution
EPSG:3395 is a mercator (cylindrical) projection with units of metres. You need a cylindrical projection in units of degrees (which is called a Plate Carree or Equidistant Cylindrical projection). Use EPSG:4326 - For example see https://geopandas.readthedocs.io/en/latest/docs/user_guide/projections.html
More info on EPSG:4326 here: https://epsg.io/4326
More info on EPSG:3395 here: https://epsg.io/3395
Discussion of Mercator compared to Plate Carree (aka Platte Carre) https://idvux.wordpress.com/2007/06/06/mercator-vs-well-not-mercator-platte-carre/
Answered By - balmy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.