I have a shapefile of world countries, downloaded from here. I can plot it in R using
countries <- readOGR("shp","TM_WORLD_BORDERS-0.3",encoding="UTF-8",stringsAsFactors=F)
par(mar=c(0,0,0,0),bg=rgb(0.3,0.4,1))
plot(countries,col=rgb(1,0.8,0.4))
Now I wanna plot it in orthographic projection (Earth seen from outer space), so I'm trying
countries <- spTransform(countries,CRS("+proj=ortho +lat_0=-10 +lon_0=-60"))
I also played with the x_0 and y_0 parameters (as stated here), but I always get the error:
non finite transformation detected:
[1] 45.08332 39.76804 Inf Inf
Erro em .spTransform_Polygon(input[[i]], to_args = to_args, from_args = from_args, :
failure in Polygons 3 Polygon 1 points 1
Além disso: Mensagens de aviso perdidas:
In .spTransform_Polygon(input[[i]], to_args = to_args, from_args = from_args, :
108 projected point(s) not finite
sometimes in the 3rd polygon, sometimes in the 7th. Where are those "Inf" coming from? I need to change any parameter? I want to plot the map like this
but centered above South America. Thanks for your help!