Class InfrastructureNetwork

    • Field Detail

      • modes

        public final Modes modes
        class instance containing all modes specific functionality across the layers
      • infrastructureLayers

        public final InfrastructureLayers infrastructureLayers
        stores the various layers grouped by their supported modes of transport
    • Constructor Detail

      • InfrastructureNetwork

        public InfrastructureNetwork​(IdGroupingToken tokenId)
        Default constructor
        Parameters:
        tokenId - to use for id generation
      • InfrastructureNetwork

        public InfrastructureNetwork​(IdGroupingToken tokenId,
                                     org.opengis.referencing.crs.CoordinateReferenceSystem coordinateReferenceSystem)
        Default constructor
        Parameters:
        tokenId - to use for id generation
        coordinateReferenceSystem - preferred coordinate reference system to use
    • Method Detail

      • getCoordinateReferenceSystem

        public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
        collect the used crs
        Returns:
        coordinateReferencesystem used by this infrastructure network
      • setCoordinateReferenceSystem

        public void setCoordinateReferenceSystem​(org.opengis.referencing.crs.CoordinateReferenceSystem coordinateReferenceSystem)
        set the coordinate reference system used for all layers
        Parameters:
        coordinateReferenceSystem - to set
      • transform

        public void transform​(org.opengis.referencing.crs.CoordinateReferenceSystem newCoordinateReferenceSystem)
                       throws PlanItException
        change the coordinate system, which will result in an update of all geometries in the network layers from the original CRS to the new CRS. If the network is empty and no CRS is set then this is identical to calling setCoordinateReferenceSystem, otherwise it will change the CRS while the set method will throw an exception
        Parameters:
        newCoordinateReferenceSystem - to transform the network to
        Throws:
        PlanItException - thrown if error
      • getInfrastructureLayerByMode

        public InfrastructureLayer getInfrastructureLayerByMode​(Mode mode)
        collect an infrastructure layer by mode (identical to this.infrastructureLayers.get(mode))
        Parameters:
        mode - to collect layer for
        Returns:
        corresponding layer, null if not found)
      • initialiseInfrastructureLayers

        public void initialiseInfrastructureLayers​(InfrastructureLayersConfigurator planitInfrastructureLayerConfiguration)
        Tries to intialise and create/register infrastructure layers via a predefined configuration rather than letting the user do this manually via the infrastructure layers container. Only possible when the network is still empty and no layers are yet active
        Parameters:
        planitInfrastructureLayerConfiguration - to use for configuration
      • removeDanglingSubnetworks

        public void removeDanglingSubnetworks()
                                       throws PlanItException
        remove any dangling subnetworks from the network's layers if they exist and subsequently reorder the internal ids if needed
        Throws:
        PlanItException - thrown if error
      • removeDanglingSubnetworks

        public 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