OSGeo / PROJ

PROJ - Cartographic Projections and Coordinate Transformations Library
https://proj.org
Other
1.75k stars 791 forks source link

'End the world' outline of a crs #4240

Open mtennekes opened 2 months ago

mtennekes commented 2 months ago

For visualisation purposes we would like to calculate the 'boundaries' of the earth from a given crs.

A naive approach that I took earlier was to transform the longlat -180, - 180, -90, - 90 bounding box to the target crs:

image

However, this clearly does not work in general. Is there a way to obtain the outline of a crs?

See also https://github.com/r-tmap/tmap/issues/929

rouault commented 2 months ago

I would suggest you use proj_trans_bounds() : https://proj.org/en/9.4/development/reference/functions.html#c.proj_trans_bounds

mtennekes commented 2 months ago

Thx @rouault but to clarify: I'm looking for the visible boundary, expecting a polygon rather than a box. In the map above, the contour that separates blue/green from white.