Skip to contents

This function will calculate the center point of each segment and it's orientation with north. More info in the Details section.

Usage

TNETshape_computePosition(path_segments, path_nodes, path_export)

Arguments

path_segments

string Path to the shapefile with segments.

export_file

string Path to the shapefile with results to create.

path_node

string Path to the shapefile with all segments nodes.

Value

None.

Details

Both position and orientation are calculated using the line between the initial and final node, called later the simplified segment (dashed on the figure below). There are symbolized in the following figure and explain below:

1 - Position

Position is taken as the middle point of the simplified segment. It's converted in WGS84.

2 - Orientation

Orientation is take as the angle between North and the oriented simplified segment, in Degrees.

OrientationWater direction in the segment
North
180°South
90°East
270°West

Examples

## Run directly the function providing all info
TNETshape_computePosition(path_segments = "path/to/segments.shp",
                          path_node = "path/to/nodes.shp",
                          export_file = "path/to/exportFolder")
#> Error: Cannot open "path/to/segments.shp"; The file doesn't seem to exist.