gridlines

0th

Percentile

Create N-S and E-W grid lines over a geographic region

Create N-S and E-W grid lines over a geographic region; gridat permits the construction of points and labels for non-projected grid annotation

Keywords
spatial
Usage
gridlines(x, easts = pretty(bbox(x)[1,]), norths = pretty(bbox(x)[2,]), ndiscr = 20) 
gridat(x, easts = pretty(bbox(x)[1,]), norths = pretty(bbox(x)[2,]), offset=0.5)
Arguments
x
object deriving from class Spatial-class
easts
numeric; east-west values for vertical lines
norths
numeric; north-south values for horizontal lines
ndiscr
integer; number of points used to discretize the line, could be set to 2, unless the grid is (re)projected
offset
offset value to be returned, see text
Value

  • gridlines returns an object of class SpatialLines-class, with lines as specified; the return object inherits the projection information of x; gridat returns a SpatialPointsDataFrame with points at the west and south ends of the grid lines created by gridlines, with degree labels

See Also

Function spTransform in package rgdal

Aliases
  • gridlines
  • gridat
Examples
data(meuse)
coordinates(meuse) = ~x+y
plot(meuse)
plot(gridlines(meuse), add=TRUE)
title("default gridlines within Meuse bounding box")
Documentation reproduced from package sp, version 0.9-17, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.