C# Class IsraelHiking.API.Services.GpxSplitterService

Inheritance: IGpxSplitterService
显示文件 Open project: IsraelHikingMap/Site

Public Methods

Method Description
GetMissingLines ( NetTopologySuite.Geometries.LineString gpxLine, IReadOnlyList existingLineStrings, double minimalMissingPartLength, double closestPointTolerance ) : List

This part of this splitter will remove line that already exsits and will split lines that are close to an exsiting line. This can be used with both OSM lines and other parts of the same GPS trace. The algorithm is faily simple - Go over all the points in the given gpxLine and look for point that are close to existingLineStrings

SplitSelfLoops ( NetTopologySuite.Geometries.LineString gpxLine, double closestPointTolerance ) : List

This part of the splitter if responsible for splitting a line with a self loop. It will allway return lines that do not have self loop, but can be duplicate of one another Use GetMissingLines method to remove those duplications.

Private Methods

Method Description
AddLineString ( ICollection gpxSplit, System.Coordinate coordinates ) : void
IsCloseToALine ( System.Coordinate coordinate, IReadOnlyList lineStrings, double closestPointTolerance ) : bool
IsClosingALoop ( NetTopologySuite.Geometries.LineString gpxLine, int currentIndex, double closestPointTolerance ) : bool

Method Details

GetMissingLines() public method

This part of this splitter will remove line that already exsits and will split lines that are close to an exsiting line. This can be used with both OSM lines and other parts of the same GPS trace. The algorithm is faily simple - Go over all the points in the given gpxLine and look for point that are close to existingLineStrings
public GetMissingLines ( NetTopologySuite.Geometries.LineString gpxLine, IReadOnlyList existingLineStrings, double minimalMissingPartLength, double closestPointTolerance ) : List
gpxLine NetTopologySuite.Geometries.LineString The line to manipulate
existingLineStrings IReadOnlyList The lines to test agains
minimalMissingPartLength double The minimal length allowed to a trace that can be added
closestPointTolerance double The distace of the closest point allowed
return List

SplitSelfLoops() public method

This part of the splitter if responsible for splitting a line with a self loop. It will allway return lines that do not have self loop, but can be duplicate of one another Use GetMissingLines method to remove those duplications.
public SplitSelfLoops ( NetTopologySuite.Geometries.LineString gpxLine, double closestPointTolerance ) : List
gpxLine NetTopologySuite.Geometries.LineString The line to look for self loops in
closestPointTolerance double The tolerance of the distance that is considered a self loop
return List