Package org.goplanit.osm.util
Class PlanitLinkSegmentUtils
- java.lang.Object
-
- org.goplanit.osm.util.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 Summary
Constructors Constructor Description PlanitLinkSegmentUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.locationtech.jts.geom.LineSegment
extractClosestLineSegmentToGeometryFromLinkSegment(org.locationtech.jts.geom.Geometry referenceGeometry, MacroscopicLinkSegment linkSegment, PlanitJtsCrsUtils geoUtils)
Extract a JTS line segment based on the closest two coordinates on the link segment geometry in its intended direction to the reference geometry providedstatic MacroscopicLinkSegment
getLinkSegmentIfLinkIsOneWayForMode(Link link, Mode accessMode)
Collect the one way link segment for the mode if the link is in fact one way.
-
-
-
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 availableaccessMode
- 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 tolinkSegment
- to extract line segment fromgeoUtils
- for distance calculations- Returns:
- line segment if found
- Throws:
PlanItException
- thrown if error
-
-