Package org.planit.network
Interface InfrastructureLayer
-
- All Superinterfaces:
Comparable<Idable>
,ExternalIdable
,Idable
- All Known Implementing Classes:
InfrastructureLayerImpl
,MacroscopicPhysicalNetwork
,PhysicalNetwork
public interface InfrastructureLayer extends ExternalIdable
An infrastructure layer represents the infrastructure suited for a number of modes. This can be in the form of a physical network or by some other (more aggregate) representation. The combination of infrastructure layers can be used to construct an intermodal network. Each layer supports one or more modes- Author:
- markr
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description 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 layerCollection<Mode>
getSupportedModes()
collect the modes supported by this infrastructure layerboolean
isEmpty()
check if the layer is empty of any infrastructurevoid
logInfo(String prefix)
invoked by entities inquiring about general information about the layer to display to usersboolean
registerSupportedMode(Mode supportedMode)
register a mode as supported by this layerboolean
registerSupportedModes(Collection<Mode> supportedModes)
register modes as supported by this layerdefault void
removeDanglingSubnetworks()
remove any dangling subnetworks from the layer if they exist and subsequently reorder the internal ids if neededvoid
removeDanglingSubnetworks(Integer belowSize, Integer aboveSize, boolean alwaysKeepLargest)
remove any dangling subnetworks below a given size from the network if they exist and subsequently reorder the internal ids if neededdefault boolean
supports(Mode mode)
Determine if mode is supported by this layervoid
transform(org.opengis.referencing.crs.CoordinateReferenceSystem fromCoordinateReferenceSystem, org.opengis.referencing.crs.CoordinateReferenceSystem toCoordinateReferenceSystem)
transform all underlying geometries in the layer from the given crs to the new crsboolean
validate()
validate the infrastructure of this layer-
Methods inherited from interface org.planit.utils.id.ExternalIdable
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
-
Methods inherited from interface org.planit.utils.id.Idable
compareTo, getId, idEquals, idHashCode
-
-
-
-
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 crstoCoordinateReferenceSystem
- 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 sizeaboveSize
- 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
-
-