Class GtfsLinkSegmentHelper


  • public class GtfsLinkSegmentHelper
    extends Object
    Utils class related to GTFS and PLANit link segment functionality
    Author:
    markr
    • Constructor Detail

      • GtfsLinkSegmentHelper

        public GtfsLinkSegmentHelper()
    • 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 check
        linkSegment - to check
        shouldBeOnLeft - flag indicating whether it should be on left, if false, it should be on the right
        geoTools - 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 use
        coordinate - to use
        data - containing state
        Returns:
        azimuth in degrees found