Learn R Programming

IceCast (version 2.1.0)

extract_coords: Function to extract coordinates.

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

extract_coords(x)

Arguments

x

SpatialLines or SpatialPolygons object

Value

n x 2 matrix of coordinates

Examples

Run this code
# NOT RUN {
coords <- extract_coords(reg_info$regions[[3]])
par(mfrow = c(1, 2))
plot(reg_info$regions[[3]], main = "Polygon Object")
plot(coords, type = "p", main = "Coordinates", pch = 20)
# }

Run the code above in your browser using DataLab