f <- system.file("RSurvey-ex/PolygonAlternativeFormat.txt", package = "RSurvey")
con <- file(f, open = "r", encoding = "latin1")
ply <- polyTranslate(file = con)
pts <- get.pts(ply)
plot(ply)
for(i in 1:length(pts)) points(get.pts(ply)[[i]], col = "red")
close(con)
con <- file(f, open = "r", encoding = "latin1")
ply <- polyTranslate(file = con, dl = 1)
pts <- get.pts(ply)
for(i in 1:length(pts)) points(get.pts(ply)[[i]], col = "green")
close(con)
Run the code above in your browser using DataLab