Learn R Programming

shp2graph (version 0-2)

ptsinnt.view: Visualize the result of integrating a set of data points with given network

Description

The function is to visualize the result of integrating a set of data points with a given network. It is an immediate visualization tool of the result from function points2network to give user an impression how the points connected with the given network.

Usage

ptsinnt.view(ntdata, nodelist, pointsxy, CoorespondIDs, VElist=NULL)

Arguments

ntdata

A “SpatialLines” or “SpatialLinesDataFrame” object;

nodelist

An nodelist object, see nodelist;

pointsxy

A two columns vector of X-Y coordinates of the given points set;

CoorespondIDs

A vector(of the length equal to the number of points) of cooresponding node IDs of each point;

VElist

A list of virtual edges if existed

See Also

points2network

Examples

Run this code
# NOT RUN {
data(ORN)
pts<-spsample(rn, 100, type="random")
ptsxy<-coordinates(pts)[,1:2]
ptsxy<-cbind(ptsxy[,1]+0.008,ptsxy[,2]+0.008)
#Mapping each point to the nearest node in the network/graph
res<-points2network(ntdata=rn,pointsxy=ptsxy, mapping.method=1)
#Visualize the results without virtual edges 
ptsinnt.view(ntdata=rn, nodelist=res[[1]], pointsxy=ptsxy, 
             CoorespondIDs=res[[3]])
#Visualize the results with virtual edges
res<-points2network(ntdata=rn,pointsxy=ptsxy, mapping.method=3,
                    ea.prop=rep(0,37))
VElist<-res[[7]]
ptsinnt.view(ntdata=rn, nodelist=res[[1]], pointsxy=ptsxy, 
             CoorespondIDs=res[[3]], VElist=VElist)
# }

Run the code above in your browser using DataLab