sp (version 0.8-3)

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

Description

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

Usage

gridlines(x, easts = pretty(bbox(x)[1,]), norths = pretty(bbox(x)[2,]), ndiscr = 20)

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

Value

  • object of class SpatialLines-class, with lines as specified; the return object inherits the projection information of x

See Also

Function transform in package spproj

Examples

Run this code
data(meuse)
coordinates(meuse) = ~x+y
plot(meuse)
plot(gridlines(meuse), add=TRUE)
title("default gridlines within Meuse bounding box")

Run the code above in your browser using DataCamp Workspace