Skip to content

09_make_segments

mike edited this page May 4, 2018 · 1 revision

Maritimes/Mar.utils - Generate lines from Related Records

May 2, 2018 - Mike McMahon (mike.mcmahon@dfo-mpo.gc.ca)

make_segments.R

This function takes a dataframe with coordinates in decimal degrees and a track identifier, and creates line segments for each distinct identifier. If specified, it will plot the results in R and/or create shapefiles.

While making segments, you can also generate a shapefile of all of the positions/vertices.

  • points = "all" will create a point shapefile that includes all of the positions.
  • points = "none" will not generate a point shapefile.
  • points = "orphans" will only create points for those "tracks" that only have a single position

NOTE: To make spatial lines of ISDB data, please check out make_isdb_tracks().

> segments = make_segments(data, objField = "MISSION", seqField = "SETNO",lat.field = "LATITUDE", lon.field = "LONGITUDE")

Missions shown as segments

Clone this wiki locally