View source: R/surveyPlanning.R
centreLawnOnPosition | R Documentation |
Centres a regular rectangular survey on a desired latitude and longitude
centreLawnOnPosition(
centreLon,
centreLat,
proj4string = NULL,
tolerance = 20,
...
)
centreLon |
Desired centre location of survey |
centreLat |
Desired centre location of survey |
proj4string |
projection string of class CRS-class. If NULL defaults to "+proj=longlat +datum=WGS84" |
tolerance |
maximum distance (in metres) between desired survey centre and realised survey centre |
... |
other arguments to be passed into lawnSurvey |
Line transect coordinates (lon, lat) as specified in lawnSurvey
## Not run:
coords=centreLawnOnPosition(centreLon=-170,centreLat=-60,lineLengthkm=2,lineSpacingkm=0.5,
startBearingdeg=30,numOfLines=5)
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)
points(-170,-60,col='purple',pch=19,cex=2)
points(geomean(coords),col='red',pch=19,cex=1)
legend('bottomright',c('Beginning','End','Desired centre','Actual centre'),
col=c('blue','blue','purple','red'),pch=c(17,15,19,19),pt.cex=c(1,1,2,1))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.