Skip to main content
1 of 4
Rodrigo
  • 784
  • 5
  • 21

How to plot a full hemispheric orthographic projection in R

I want to make a plot like that using R:

orthographic projection

All I want is the country borders as seen from outer space, no fancy colors needed. It seems I need to use the spTransform function, but it gives me a "non finite transformation detected" error. I've been told that I need to apply a cosine formula to each point in my world shapefile, and erase those that goes behind the Earth. This have 2 problems:

  1. it looks like something the algorithm should do automatically;
  2. I cannot just erase the points behind the Earth, cause this would destroy the topology of the polygons.

Isn't it a simple task? How should I do it? Thanks in advance!

Rodrigo
  • 784
  • 5
  • 21