Learn R Programming

spNetwork (version 0.2.1)

add_vertices_lines: Add vertices to a SpatialLinesDataFrame

Description

Add vertices (SpatialPoints) to their nearest lines (SpatialLines), may fail if the line geometries are self intersecting.

Usage

add_vertices_lines(lines, points, nearest_lines_idx, mindist)

Arguments

lines

The SpatialLinesDataframe to modify

points

The SpatialPoints to add to as vertex to the lines

nearest_lines_idx

For each point, the index of the nearest line

mindist

The minimum distance between one point and the extremity of the line to add the point as a vertex.

Value

An object of class SpatialLinesDataFrame (package sp)

Examples

Run this code
# NOT RUN {
#This is an internal function, no example provided
# }

Run the code above in your browser using DataLab