Interface InfrastructureLayer

    • Method Detail

      • createLayerLogPrefix

        static String createLayerLogPrefix​(InfrastructureLayer layer)
        create a string that can be used to prefix log statements for this layer to - in a unified way - identify this statement came from a particular layer
        Parameters:
        layer - to use
        Returns:
        String "[layer: xmlID ]"
      • registerSupportedMode

        boolean registerSupportedMode​(Mode supportedMode)
        register a mode as supported by this layer
        Parameters:
        supportedMode - to support
        Returns:
        true when successful false otherwise
      • registerSupportedModes

        boolean registerSupportedModes​(Collection<Mode> supportedModes)
        register modes as supported by this layer
        Parameters:
        supportedModes - to support
        Returns:
        true when successful false otherwise
      • getSupportedModes

        Collection<Mode> getSupportedModes()
        collect the modes supported by this infrastructure layer
        Returns:
        the supported modes for at least some part of the available infrastructure
      • supports

        default boolean supports​(Mode mode)
        Determine if mode is supported by this layer
        Parameters:
        mode - to verify
        Returns:
        true when supporting, false otherwise
      • isEmpty

        boolean isEmpty()
        check if the layer is empty of any infrastructure
        Returns:
        true when empty, false otherwise
      • logInfo

        void logInfo​(String prefix)
        invoked by entities inquiring about general information about the layer to display to users
        Parameters:
        prefix - optional prefix to include in each line of logging
      • validate

        boolean validate()
        validate the infrastructure of this layer
        Returns:
        true when valid, false otherwise
      • transform

        void transform​(org.opengis.referencing.crs.CoordinateReferenceSystem fromCoordinateReferenceSystem,
                       org.opengis.referencing.crs.CoordinateReferenceSystem toCoordinateReferenceSystem)
                throws PlanItException
        transform all underlying geometries in the layer from the given crs to the new crs
        Parameters:
        fromCoordinateReferenceSystem - presumed current crs
        toCoordinateReferenceSystem - to tranform to crs
        Throws:
        PlanItException - thrown if error
      • removeDanglingSubnetworks

        default void removeDanglingSubnetworks()
                                        throws PlanItException
        remove any dangling subnetworks from the layer if they exist and subsequently reorder the internal ids if needed
        Throws:
        PlanItException - thrown if error
      • removeDanglingSubnetworks

        void removeDanglingSubnetworks​(Integer belowSize,
                                       Integer aboveSize,
                                       boolean alwaysKeepLargest)
                                throws PlanItException
        remove any dangling subnetworks below a given size from the network if they exist and subsequently reorder the internal ids if needed
        Parameters:
        belowSize - remove subnetworks below the given size
        aboveSize - remove subnetworks above the given size (typically set to maximum value)
        alwaysKeepLargest - when true the largest of the subnetworks is always kept, otherwise not
        Throws:
        PlanItException - thrown if error