Package org.goplanit.gtfs.util
Class GtfsLinkSegmentHelper
- java.lang.Object
-
- org.goplanit.gtfs.util.GtfsLinkSegmentHelper
-
public class GtfsLinkSegmentHelper extends Object
Utils class related to GTFS and PLANit link segment functionality- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description GtfsLinkSegmentHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
getAzimuthFromLinkSegmentToCoordinate(LinkSegment linkSegment, org.locationtech.jts.geom.Coordinate coordinate, GtfsZoningHandlerData data)
Based on coordinate draw a virtual line to closest intersection point on link segment and identify the azimuth (0-360 degrees) that goes with this virtual line from the intersection point on the link segment towards the coordinate providedstatic boolean
isGeometryOnCorrectSideOfLinkSegment(org.locationtech.jts.geom.Geometry geometry, LinkSegment linkSegment, boolean shouldBeOnLeft, PlanitJtsCrsUtils geoTools)
check if geometry is on correct side of link segment by taking the link segment's extreme nodes as reference point.
-
-
-
Method Detail
-
isGeometryOnCorrectSideOfLinkSegment
public static boolean isGeometryOnCorrectSideOfLinkSegment(org.locationtech.jts.geom.Geometry geometry, LinkSegment linkSegment, boolean shouldBeOnLeft, PlanitJtsCrsUtils geoTools)
check if geometry is on correct side of link segment by taking the link segment's extreme nodes as reference point. For long links this is probably not a good approach.- Parameters:
geometry
- to checklinkSegment
- to checkshouldBeOnLeft
- flag indicating whether it should be on left, if false, it should be on the rightgeoTools
- to use- Returns:
- true when correct, false otherwise
-
getAzimuthFromLinkSegmentToCoordinate
public static double getAzimuthFromLinkSegmentToCoordinate(LinkSegment linkSegment, org.locationtech.jts.geom.Coordinate coordinate, GtfsZoningHandlerData data)
Based on coordinate draw a virtual line to closest intersection point on link segment and identify the azimuth (0-360 degrees) that goes with this virtual line from the intersection point on the link segment towards the coordinate provided- Parameters:
linkSegment
- to usecoordinate
- to usedata
- containing state- Returns:
- azimuth in degrees found
-
-