Search code examples
pythongeopandaspyproj

Winkel Tripel projection in Geopandas


I would like to use the Winkel Tripel projection with GeoPandas 0.8.1

Consider the following example.

import geopandas as gpd

world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
world = world[(world.name != "Antarctica") & (world.name != "Fr. S. Antarctic Lands")]
world['gdp_per_cap'] = world.gdp_md_est / world.pop_est
world = world.to_crs(epsg=3395)
world.plot(column = 'gdp_per_cap')

This example is based on the GeoPandas tutorial on managing projections, and reprojects to Mercator.

First, I tried reprojecting to Winkel Tripel using an epsg code. However, it seems that this projection does not have such a code (i.e. I can't seem to find this projection on EPSG.io).

Next, I tried looking for a list of supported epsg codes. This made me realize that this functionality in fact is handled by pyproj.

While PROJ does seem to support Winkel Tripel, I haven't figured out if and how I can get this functionality to work in this case.

I suspected that I could invoke the proj string wintri, but did not figure out how.

I seem to have found a mention of wintri in the source code of v2.1.3, however I can't seem to find anything in the documentation of the current stable version.

Finally, I came across this exchange which lead me to suspect that it is not possible to use the Winkel Tripel projection in PROJ, and by extension GeoPandas.

That thread is from 2015 and I haven't found any development regarding this.

In conclusion, am I understanding correctly that it is not possible to use the Winkel Tripel projection with GeoPandas?

Or if it is possible, what am I missing?

Any help is much appreciated.


Solution

  • If I am not mistaken, this is the correct and simple way:

    world = world.to_crs('+proj=wintri')
    world.plot()
    

    enter image description here