Learn R Programming

tmap (version 0.7)

fit_polylines: Fit polylines through a set of spatial points

Description

Fit one or more smooth polylines through a set of spatial points. (Experimental, see note)

Usage

fit_polylines(..., id = NULL, min.dist = 10, max.opt.dist = 250,
  sep.dist = 5000, verbose = TRUE)

Arguments

...
Shape object(s) from which spatial points are taken. A shape object is one of
  1. SpatialPolygons(DataFrame)

Value

  • SpatialLinesDataframe

item

  • id
  • min.dist
  • max.opt.dist
  • sep.dist
  • verbose

code

sep.dist

Details

Method: the coordinates from all shape objects are collected per category (defined by id). Per category, the following steps are taken: 1) coordinates that are closer than min.dist from each other are grouped, where the group means are considered as coordination points subsequently; 2) the coordination points are clustered by fitting a minimum spanning tree where edges longer than sep.dist are removed; 3) for each cluster, a graph is created by adding an edge for any two coordinate points that are at least max.opt.dist far away from each other. Also, the edges of a fitted minimum spanning tree are added to the graph; 4) for each cluster, the shortest path is found within the constructed graph between the two coordinate points that are fartest away from each other.