The coordinate list is generated in degrees decimal degree format (dd.ddd), with Southern hemisphere denoted by negative numbers. Transect length are specified in km and bearings in degress where North 0 deg, East 90 deg, South 180 deg and West 270 deg.
zigzagSurvey(startLon, startLat, lineLengthkm, startBearingdeg, rotationdeg, numOfLines, proj4string = CRS("+proj=longlat +datum=WGS84"), unrotated = FALSE)
startLon | start longitude of survey. |
---|---|
startLat | start latitude of survey. |
lineLengthkm | transect line length in km. |
startBearingdeg | Bearing of each transect in degrees. |
rotationdeg | rotation angle for entire survey pattern. |
numOfLines | Number of transects. |
proj4string | projection string of class CRS-class |
unrotated |
|
Geographical coordinates of start and end of line positions. unrotated=TRUE
list of rotated and unrotated coordinates
zigzagSurvey
# NOT RUN { coords=zigzagSurvey(startLon=-100,startLat=-60,lineLengthkm=2, startBearingdeg=30, rotationdeg=10,numOfLines=11) plot(0,0,xlim=range(coords[,1]),ylim=range(coords[,2]),type='n', xlab='Longitude, deg',ylab='Latitude, deg') arrows(x0=coords[1:(nrow(coords)-1),1], y0=coords[1:(nrow(coords)-1),2], x1 = coords[2:nrow(coords),1], y1 = coords[2:nrow(coords),2]) text(coords,row.names(coords),cex=0.6) points(coords[1,1],coords[1,2],col='blue',pch=17,cex=2) points(coords[nrow(coords),1],coords[nrow(coords),2],col='blue',pch=15,cex=2) legend('topright',c('Beginning','End'),col='blue',pch=c(17,15)) #Use unrotated=TRUE and check coordinates in the- #-returned coordinate list object are identical: coordL= zigzagSurvey(startLon=-100,startLat=-60,lineLengthkm=2, startBearingdeg=30, rotationdeg=0,numOfLines=11,unrotated=TRUE) identical(coordL[[1]],coordL[[2]]) #display rotated and unrotated coordinates" coordL= zigzagSurvey(startLon=-100,startLat=-60,lineLengthkm=2, startBearingdeg=30, rotationdeg=5,numOfLines=11,unrotated=TRUE) coords=coordL$unrotatedGeogs; coordsRotate=coordL$rotatedGeogs plot(0,0,xlim=range(c(coords[,1],coordsRotate[,1])), ylim=range(c(coords[,2],coordsRotate[,2])),type='n', xlab='Longitude, deg',ylab='Latitude, deg') arrows(x0=coords[1:(nrow(coords)-1),1], y0=coords[1:(nrow(coords)-1),2], x1 = coords[2:nrow(coords),1], y1 = coords[2:nrow(coords),2]) arrows(x0=coordsRotate[1:(nrow(coordsRotate)-1),1], y0=coordsRotate[1:(nrow(coordsRotate)-1),2], x1 = coordsRotate[2:nrow(coordsRotate),1], y1 = coordsRotate[2:nrow(coordsRotate),2],col='blue') legend('bottomleft',c('Unrotated','Rotated'),lty=1,col=c(1,'blue')) # }