Interface Edge

    • Field Detail

      • EDGE_ID_CLASS

        static final Class<Edge> EDGE_ID_CLASS
        id class for generating ids
    • Method Detail

      • isVertexA

        default boolean isVertexA​(Vertex vertex)
        Verify if passed in vertex is the same object reference as vertex A
        Parameters:
        vertex - to check
        Returns:
        true when identical object instance, false otherwise
      • getGeometry

        org.locationtech.jts.geom.LineString getGeometry()
        Collect the geometry of this line
        Returns:
        lineString
      • setGeometry

        void setGeometry​(org.locationtech.jts.geom.LineString lineString)
        set the geometry of this link as a line string
        Parameters:
        lineString - to set
      • populateBasicGeometry

        default boolean populateBasicGeometry​(boolean overwrite)
        Utilising the A and B vertex construct a direct line between the two points as the geometry
        Parameters:
        overwrite - when true, overwrite existing geometry, otherwise ignore
        Returns:
        true when successful, false otherwise
      • removeVertex

        boolean removeVertex​(Vertex vertex)
        Remove vertex from edge
        Parameters:
        vertex - to remove
        Returns:
        true when successful false otherwise
      • getVertexA

        Vertex getVertexA()
        Vertex A of the edge
        Returns:
        vertex A
      • getVertexB

        Vertex getVertexB()
        Vertex B of the edge
        Returns:
        vertex B
      • setName

        void setName​(String name)
        set the name of the edge
        Parameters:
        name - to set
      • getName

        String getName()
        get the name of the edge
        Returns:
        name
      • setLengthKm

        void setLengthKm​(double lengthInKm)
        set length of this edge in km
        Parameters:
        lengthInKm - of this edge in km
      • getLengthKm

        double getLengthKm()
        Return length of this edge in km
        Returns:
        length of this edge in km
      • addInputProperty

        void addInputProperty​(String key,
                              Object value)
        Add a property from the original input that is not part of the readily available link members
        Parameters:
        key - (name) of input property
        value - of input property
      • getInputProperty

        Object getInputProperty​(String key)
        Get input property by its key
        Parameters:
        key - of input property
        Returns:
        value retrieved value of input property
      • replace

        boolean replace​(Vertex vertextoReplace,
                        Vertex vertexToReplaceWith)
        Replace one of the vertices of the link
        Parameters:
        vertextoReplace - the vertex to replace
        vertexToReplaceWith - the vertex to replace with
        Returns:
        true when replaced, false otherwise
      • deepClone

        Edge deepClone()
        Deep copy, non-owned members are reference copied
        Specified by:
        deepClone in interface GraphEntity
        Specified by:
        deepClone in interface IdAble
        Returns:
        copy of this edge
      • validate

        boolean validate()
        validate the contents of this edge
        Returns:
        true when valid, false otherwise
      • getIdClass

        default Class<? extends Edge> getIdClass()
        All edges use the EDGE_ID_CLASS to generate the unique internal ids
        Specified by:
        getIdClass in interface ManagedId
        Returns:
        idClass to use for generating ids for instances of this idable derived class
      • hasName

        default boolean hasName()
        Verify if a name has been set
        Returns:
        true when present, false otherwise
      • hasVertex

        default boolean hasVertex​(Vertex vertex)
        check if vertex is present on the edge
        Parameters:
        vertex - to check
        Returns:
        true when present false otherwise
      • hasVertexA

        default boolean hasVertexA()
        Verify if vertex A is available
        Returns:
        true when present, false otherwise
      • hasVertexB

        default boolean hasVertexB()
        Verify if vertex B is available
        Returns:
        true when present, false otherwise
      • hasVertices

        default boolean hasVertices()
        Verify if vertex A and B are available
        Returns:
        true when present, false otherwise
      • hasGeometry

        default boolean hasGeometry()
        check if geometry is available
        Returns:
        true when available, false otherwise
      • isGeometryInAbDirection

        default boolean isGeometryInAbDirection()
        verify if the geometry is in the A to B direction of the link, both vertices must have geometry present.
        Returns:
        true if in A to B direction, false otherwise
      • isGeometryInAbDirection

        default boolean isGeometryInAbDirection​(boolean allowSingleVertexWithoutGeometry)
        verify if the geometry is in the A to B direction of the edge. When one of the vertices has no geometry, we may or may not allow for this. If this is the case, we enforce that at least one end of the geometry is matched to the other vertex's geometry to infer direction.
        Parameters:
        allowSingleVertexWithoutGeometry - when true, we assume that geometry of edge is ok to be not matching vertex on one end
        Returns:
        true if in A to B direction, false otherwise
      • transformGeometry

        default void transformGeometry​(org.opengis.referencing.operation.MathTransform transformer)
                                throws org.opengis.geometry.MismatchedDimensionException,
                                       org.opengis.referencing.operation.TransformException
        transform the line string information of this edge using the passed in MathTransform
        Parameters:
        transformer - to apply
        Throws:
        org.opengis.geometry.MismatchedDimensionException - thrown if error
        org.opengis.referencing.operation.TransformException - thrown if error
      • updateGeometryInjectCoordinateAtProjectedLocation

        default org.locationtech.jts.geom.Geometry updateGeometryInjectCoordinateAtProjectedLocation​(org.locationtech.jts.linearref.LinearLocation projectedLinearLocation)
        Update the geometry by taking the current geometry and inject a coordinate at the projected location between existing coordinates using the passed in location. this replaces the existing geometry instance which is returned.
        Parameters:
        projectedLinearLocation - to use as reference point of new coordinate
        Returns:
        old geometry that is now replaced
      • createEnvelope

        default org.locationtech.jts.geom.Envelope createEnvelope()
        collect the bounding box of the geometry of this link
        Returns:
        envelope (bounding box) of this link based on its geometry