Skip to content
Prev 21928 / 29559 Next

Antarctica map

On Fri, Oct 31, 2014 at 9:08 PM, Monika Wagner <mw.moni.wagner at gmail.com> wrote:
Hello, basically there are dummy points to extend the "longlat" view
of the world to the pole. Obviously these dummy vertices aren't needed
in Orthographic projection, since the polygon surrounds the pole
(rather than trying to traverse a line around a point smeared
impossibly in the plane) but without a reverse pathway to remove them
we have to mess around a bit to hide the tear. You can also turn off
the border colouring and the "tear" becomes invisible (well it does in
base plot, I don't know how to get ggplot2 to do that).

library(raster)
an <- getData("GADM", country = "ATA", level = 0)

## quick check for most southerly lats
lats <- coordinates(as(as(an, "SpatialLines"), "SpatialPoints"))[,2]
## note that lat has been interpolated from the pole to around -86.4

## find the latitude to trim to
nthlat <- 71
latlimit <- min(lats[lats > sort(lats)[nthlat]] )
plot(head(sort(lats), 100))
abline(h = latlimit)

## build a raster to shortcut SpatialPolygons creation
r <- raster(extent(-180, 180, latlimit, 90))
cr <- as(extent(r), "SpatialPolygons")
proj4string(cr) <- CRS(proj4string(an))

library(rgeos)
an0 <- gIntersection(an, cr, byid = TRUE)

## I don't get what happens with geom_path when
## nthlat = 71 (?) but consider using these sources instead:
## https://gis.ccamlr.org/home
## http://www.quantarctica.org/
## or https://data.aad.gov.au/ (offline right this minute)

## set nthlat to 70 for use with geom_path


## another reprojection pathway to prove the point
library(rgdal)
an2 <- spTransform(an0, CRS("+proj=ortho +lat_0=-90 +ellps=WGS84
+datum=WGS84 +no_defs +towgs84=0,0,0"))
plot(an2)


The layer wrld_simpl is a bit tidyier with only the dummy points at
the extremes, these data have been "densified" to insert these
redundant vertices so it looks ok in many (not all) other projections.

There's very good discussions about the ultimate source of the problem here:

http://bost.ocks.org/mike/example/

http://vimeo.com/106198518

BTW, I'm happy to help with any Southern Ocean mapping issues, I've
learnt a whole lot of tricks in recent months.

Cheers, Mike.