extractCoords: Function to extract coordinates.

Description Usage Arguments Value Examples

View source: R/misc.R

Description

Function to extract coordinates from a SpatialLines object. If there are breaks in the line, this function connects the closest points to create one line. Note: This differs from the function getCoords in that the ordering of the points is considered.

Usage

1

Arguments

x

SpatialLines or SpatialPolygons object

Value

n x 2 matrix of coordinates

Examples

1
2
3
4
coords <- extractCoords(regionInfo$regions[[3]])
par(mfrow = c(1, 2))
plot(regionInfo$regions[[3]], main = "Polygon Object")
plot(coords, type = "p", main = "Coordinates", pch = 20)

hdirector/IceCastV2 documentation built on Dec. 9, 2018, 12:27 a.m.