Class PlanitLinkSegmentUtils


  • public class PlanitLinkSegmentUtils
    extends Object
    Utilities regarding PLANit link segments useful when parsing OSM entities and converting them into PLANit link segments or other PLANit entities that have something to do with link segments.
    Author:
    markr
    • Constructor Detail

      • PlanitLinkSegmentUtils

        public PlanitLinkSegmentUtils()
    • Method Detail

      • getLinkSegmentIfLinkIsOneWayForMode

        public static MacroscopicLinkSegment getLinkSegmentIfLinkIsOneWayForMode​(Link link,
                                                                                 Mode accessMode)
        Collect the one way link segment for the mode if the link is in fact one way. If it is not (for the mode), null is returned
        Parameters:
        link - to collect one way edge segment (for mode) from, if available
        accessMode - to check one-way characteristic
        Returns:
        edge segment that is one way for the mode, i.e., the other edge segment (if any) does not support this mode, null if this is not the case
      • extractClosestLineSegmentToGeometryFromLinkSegment

        public static org.locationtech.jts.geom.LineSegment extractClosestLineSegmentToGeometryFromLinkSegment​(org.locationtech.jts.geom.Geometry referenceGeometry,
                                                                                                               MacroscopicLinkSegment linkSegment,
                                                                                                               PlanitJtsCrsUtils geoUtils)
                                                                                                        throws PlanItException
        Extract a JTS line segment based on the closest two coordinates on the link segment geometry in its intended direction to the reference geometry provided
        Parameters:
        referenceGeometry - to find closest line segment to
        linkSegment - to extract line segment from
        geoUtils - for distance calculations
        Returns:
        line segment if found
        Throws:
        PlanItException - thrown if error