Package org.goplanit.network
Class TopologicalLayerNetwork<T extends TopologicalLayer,U extends TopologicalLayers<T>>
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<Network>
-
- org.goplanit.network.Network
-
- org.goplanit.network.LayeredNetwork<T,U>
-
- org.goplanit.network.TopologicalLayerNetwork<T,U>
-
- All Implemented Interfaces:
Serializable,Comparable<IdAble>,EventListener,PlanitComponentListener,EventListener,ExternalIdAble,IdAble
- Direct Known Subclasses:
ServiceNetwork,UntypedPhysicalNetwork
public abstract class TopologicalLayerNetwork<T extends TopologicalLayer,U extends TopologicalLayers<T>> extends LayeredNetwork<T,U>
A network with topological transport layers, meaning that apart from representing a physical reality the result is topologically meaningful, has nodes, links, and some geographic notion via a coordinate reference system- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.goplanit.network.Network
MACROSCOPIC_NETWORK, networkIdGroupingToken
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTopologicalLayerNetwork(TopologicalLayerNetwork<T,U> other, boolean deepCopy, ManagedIdDeepCopyMapper<Mode> modeMapper, ManagedIdDeepCopyMapper<T> layerMapper)Copy constructor.TopologicalLayerNetwork(IdGroupingToken tokenId)Default constructorTopologicalLayerNetwork(IdGroupingToken tokenId, org.opengis.referencing.crs.CoordinateReferenceSystem coordinateReferenceSystem)Default constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.locationtech.jts.geom.EnvelopecreateBoundingBox()Based on the underlying layer geographies construct a rectangular bounding box reflecting the extremities of the network.abstract TopologicalLayerNetworkdeepClone()deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possibleorg.opengis.referencing.crs.CoordinateReferenceSystemgetCoordinateReferenceSystem()collect the used crsvoidsetCoordinateReferenceSystem(org.opengis.referencing.crs.CoordinateReferenceSystem coordinateReferenceSystem)set the coordinate reference system used for all layersabstract TopologicalLayerNetworkshallowClone()Create a shallow copy of this entityvoidtransform(org.opengis.referencing.crs.CoordinateReferenceSystem newCoordinateReferenceSystem)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.-
Methods inherited from class org.goplanit.network.LayeredNetwork
createLayersContainer, getLayerByMode, getLayerByPredefinedModeType, getModes, getTransportLayers, isEmpty, reset
-
Methods inherited from class org.goplanit.network.Network
collectSettingsAsKeyValueMap, getNetworkGroupingTokenId, logInfo
-
Methods inherited from class org.goplanit.component.PlanitComponent
equals, getComponentType, getExternalId, getId, getIdGroupingToken, getKnownSupportedEventTypes, getXmlId, hashCode, onPlanitComponentEvent, setExternalId, setXmlId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.event.EventListener
hasKnownSupportedEventTypes
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, hasExternalId, hasXmlId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, idEquals, idHashCode
-
-
-
-
Constructor Detail
-
TopologicalLayerNetwork
public TopologicalLayerNetwork(IdGroupingToken tokenId)
Default constructor- Parameters:
tokenId- to use for id generation
-
TopologicalLayerNetwork
public TopologicalLayerNetwork(IdGroupingToken tokenId, org.opengis.referencing.crs.CoordinateReferenceSystem coordinateReferenceSystem)
Default constructor- Parameters:
tokenId- to use for id generationcoordinateReferenceSystem- preferred coordinate reference system to use
-
TopologicalLayerNetwork
protected TopologicalLayerNetwork(TopologicalLayerNetwork<T,U> other, boolean deepCopy, ManagedIdDeepCopyMapper<Mode> modeMapper, ManagedIdDeepCopyMapper<T> layerMapper)
Copy constructor. Beware shallow copy only for managed id containers.- Parameters:
other- to copydeepCopy- when true, create a deep copy, shallow copy otherwisemodeMapper- to use for tracking mapping between original and copied modeslayerMapper- to use for tracking mapping between original and copied layers
-
-
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 PlanItExceptionchange 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
-
createBoundingBox
public org.locationtech.jts.geom.Envelope createBoundingBox()
Based on the underlying layer geographies construct a rectangular bounding box reflecting the extremities of the network. Note this is created from scratch with every call, so for large networks this is a costly operation- Returns:
- bounding box envelope
-
shallowClone
public abstract TopologicalLayerNetwork shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClonein interfaceIdAble- Specified by:
shallowClonein classLayeredNetwork<T extends TopologicalLayer,U extends TopologicalLayers<T>>- Returns:
- shallow copy of entity
-
deepClone
public abstract TopologicalLayerNetwork deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible- Specified by:
deepClonein interfaceIdAble- Specified by:
deepClonein classLayeredNetwork<T extends TopologicalLayer,U extends TopologicalLayers<T>>- Returns:
- deep copy of entity
-
-