Class PlanitOsmNetwork
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<Network>
-
- org.goplanit.network.Network
-
- org.goplanit.network.LayeredNetwork<T,U>
-
- org.goplanit.network.TopologicalLayerNetwork<L,LS>
-
- org.goplanit.network.UntypedPhysicalNetwork<MacroscopicNetworkLayer,MacroscopicNetworkLayers>
-
- org.goplanit.network.MacroscopicNetwork
-
- org.goplanit.osm.physical.network.macroscopic.PlanitOsmNetwork
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,EventListener
,PlanitComponentListener
,EventListener
,ExternalIdAble
,IdAble
public class PlanitOsmNetwork extends MacroscopicNetwork
Macroscopic network with additional OSM functionality Disclaimer: The descriptions for the default OSM link segment types have been copied from the OSM Wiki- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Map<String,Map<NetworkLayer,MacroscopicLinkSegmentType>>>
defaultPlanitOsmLinkSegmentTypes
the PLANit link segment types per layer (value) that are activated for this osm way (key, value)protected static Set<String>
supportedOsmRailLinkSegmentTypes
the list of rail types for which we have default link segment type mapping available out of the boxprotected static Set<String>
supportedOsmRoadLinkSegmentTypes
the list of road types for which we have default link segment type mapping available out of the boxprotected static Set<String>
supportedOsmWaterLinkSegmentTypes
the list of water way types for which we have default link segment type mapping available out of the box-
Fields inherited from class org.goplanit.network.Network
MACROSCOPIC_NETWORK, networkIdGroupingToken
-
-
Constructor Summary
Constructors Constructor Description PlanitOsmNetwork()
Default ConstructorPlanitOsmNetwork(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<PredefinedModeType>
collectMappedPlanitModeTypes(String osmWayLikeKey, String osmWayLikeValue, OsmNetworkReaderSettings settings)
collect the PLANit (predefined) mode types that are mapped, i.e., are marked to be activated in the final network.void
createAndRegisterOsmCompatibleLinkSegmentTypes(OsmNetworkReaderSettings settings)
Create the link segment types that are marked in the passed in settings.void
createAndRegisterOsmCompatiblePlanitPredefinedModes(OsmNetworkReaderSettings settings)
Based on the settings we create instances of the activated OSM to PLANit mode mappings, for each created mode, append the OSM modes its represents as a list of semicolon separated entriesprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createBridleway(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create bridleway type with defaults For horse riders.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createCycleway(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create cycleway type with defaults For designated cyclewaysprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createDefaultOsmLinkSegmentType(String nameKey, String nameValue, double capacityPcuPerhour, double maxSpeedKmh, Collection<? extends Mode> modes)
Create an OSM default link segment type with name (namekey=)namevalueprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createFerry(double osmwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create ferry way type with defaultsprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createFootway(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create footway type with defaults For designated footpaths; i.e., mainly/exclusively for pedestrians.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createFunicular(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create funicular (rail) type with defaultsprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createLightRail(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create light rail (rail) type with defaultsprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createLivingStreet(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create living street type with defaults Roads which serve as an access to housing, without function of connecting settlements.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createMonoRail(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create mono rail (rail) type with defaultsprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createMotorway(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create motorway type with defaults restricted access major divided highway, normally with 2 or more running lanes plus emergency hard shoulder.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createMotorwayLink(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create motorway link type with defaults The link roads (sliproads/ramps) leading to/from a motorway from/to a motorway or lower class highway.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createNarrowGauge(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create narrow gauge(rail) type with defaultsprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createOsmCompatibleRailLinkSegmentTypeByLayer(String osmWayValue, OsmNetworkReaderSettings settings)
create the rail based link segment type based on the settingprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createOsmCompatibleRoadLinkSegmentTypeByLayer(String osmWayValue, OsmNetworkReaderSettings settings)
create the road based link segment type based on the settingprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createOsmCompatibleWaterLinkSegmentTypeByLayer(String osmWayValue, OsmNetworkReaderSettings settings)
create the water based link segment type based on the settingprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createOsmLinkSegmentType(String externalId, double capacityPcuPerhour, double maxDensityPcuPerKm, double maxSpeed, Collection<? extends Mode> modes)
Create OSM default link segment types with mode properties where we create multiple types if modes reside on different layers in which case only the modes on that layer will be added to the layer specific typeprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createOsmRailWayLinkSegmentType(String railwayTypeValue, double maxSpeed, Collection<? extends Mode> modes)
Create a link segment type on the network based on the passed in OSM railway value tagsprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createOsmRoadWayLinkSegmentType(String highwayTypeValue, double maxSpeed, Collection<? extends Mode> modes)
Create a link segment type on the network based on the passed in OSM highway value tags.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createOsmWaterWayLinkSegmentType(String waterwayValue, double maxSpeed, Collection<? extends Mode> modes)
Create a link segment type on the network based on the passed in OSM waterway route value tagsprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createPath(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create path type with defaults A non-specific path either multi-use or unspecified usage, open to all non-motorized vehicles and not intended for motorized vehicles unless tagged so separatelyprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createPedestrian(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create pedestrian type with defaults For roads used mainly/exclusively for pedestrians in shopping and some residential areas which may allow access by motorised vehicles only for very limited periods of the day.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createPrimary(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create primary type with defaults The next most important roads in a country's system (after trunk).protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createPrimaryLink(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create primary link type with defaults The link roads (sliproads/ramps) leading to/from a primary road from/to a primary road or lower class highway.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createRail(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create rail type with defaultsprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createResidential(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create residential type with defaults Roads which serve as an access to housing, without function of connecting settlements.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createRoad(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create road type with defaults A road/way/street/motorway/etc.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createSecondary(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create secondary type with defaults The link roads (sliproads/ramps) leading to/from a primary road from/to a primary road or lower class highway.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createSecondaryLink(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create secondary link type with defaults The link roads (sliproads/ramps) leading to/from a secondary road from/to a secondary road or lower class highway.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createService(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create service type with defaults For access roads to, or within an industrial estate, camp site, business park, car park, alleys, etc.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createSteps(double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create step type with defaults For flights of steps (stairs) on footwaysprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createSubway(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create subway type with defaultsprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createTertiary(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create tertiary type with defaults The next most important roads in a country's system (after secondary).protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createTertiaryLink(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create tertiary link type with defaults The link roads (sliproads/ramps) leading to/from a tertiary road from/to a tertiary road or lower class highway.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createTrack(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create track type with defaults Roads for mostly agricultural or forestry uses.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createTram(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create tram type with defaultsprotected Map<NetworkLayer,MacroscopicLinkSegmentType>
createTrunk(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create trunk type with defaults The most important roads in a country's system that aren't motorways.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createTrunkLink(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create trunk link type with defaults restricted access major divided highway, normally with 2 or more running lanes plus emergency hard shoulder.protected Map<NetworkLayer,MacroscopicLinkSegmentType>
createUnclassified(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create unclassified type with defaults The least important through roads in a country's system – i.e.protected Set<PredefinedMode>
getAvailableModesFromModeTypes(Collection<PredefinedModeType> predefinedModeTypes)
given predefined mode types, obtain the mode instances on the network that correspond to themMap<NetworkLayer,MacroscopicLinkSegmentType>
getDefaultLinkSegmentTypeByOsmTag(String osmWayKey, String osmWayTypeTagValue)
Find the link segment type (per layer) by the Highway/railway/waterwayroute=value, where we pass in the "value"-
Methods inherited from class org.goplanit.network.MacroscopicNetwork
createAndRegisterLayers, createLayersContainer, createSimpleGrid, deepClone, logInfo, shallowClone
-
Methods inherited from class org.goplanit.network.UntypedPhysicalNetwork
removeDanglingSubnetworks, removeDanglingSubnetworks
-
Methods inherited from class org.goplanit.network.TopologicalLayerNetwork
createBoundingBox, getCoordinateReferenceSystem, setCoordinateReferenceSystem, transform
-
Methods inherited from class org.goplanit.network.LayeredNetwork
getLayerByMode, getLayerByPredefinedModeType, getModes, getTransportLayers, isEmpty, reset
-
Methods inherited from class org.goplanit.network.Network
collectSettingsAsKeyValueMap, getNetworkGroupingTokenId
-
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
-
-
-
-
Field Detail
-
supportedOsmRoadLinkSegmentTypes
protected static final Set<String> supportedOsmRoadLinkSegmentTypes
the list of road types for which we have default link segment type mapping available out of the box
-
supportedOsmRailLinkSegmentTypes
protected static final Set<String> supportedOsmRailLinkSegmentTypes
the list of rail types for which we have default link segment type mapping available out of the box
-
supportedOsmWaterLinkSegmentTypes
protected static final Set<String> supportedOsmWaterLinkSegmentTypes
the list of water way types for which we have default link segment type mapping available out of the box
-
defaultPlanitOsmLinkSegmentTypes
protected final Map<String,Map<String,Map<NetworkLayer,MacroscopicLinkSegmentType>>> defaultPlanitOsmLinkSegmentTypes
the PLANit link segment types per layer (value) that are activated for this osm way (key, value)
-
-
Constructor Detail
-
PlanitOsmNetwork
public PlanitOsmNetwork()
Default Constructor
-
PlanitOsmNetwork
public PlanitOsmNetwork(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- to use for id generation
-
-
Method Detail
-
createOsmRoadWayLinkSegmentType
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createOsmRoadWayLinkSegmentType(String highwayTypeValue, double maxSpeed, Collection<? extends Mode> modes)
Create a link segment type on the network based on the passed in OSM highway value tags. In case PLANit modes on different network layers exist, then we must register multiple link segment types, differentiated by their modes. For example an OSM link that supports pedestrians and cars, could require mapping to an active network layer and an on-street layer requiring a active layer link segment type version and one for on-street, the former supporting the active modes on that layer and the latter the on-street modes.- Parameters:
highwayTypeValue
- of OSM way keymaxSpeed
- to utilise for this osm highway typemodes
- planit modes that determine what layer(s) the link segment type is to be registered on- Returns:
- created link segment type per layer if available
-
createOsmRailWayLinkSegmentType
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createOsmRailWayLinkSegmentType(String railwayTypeValue, double maxSpeed, Collection<? extends Mode> modes)
Create a link segment type on the network based on the passed in OSM railway value tags- Parameters:
railwayTypeValue
- of OSM way keymaxSpeed
- to utilise for this osm railway typemodes
- planit modes that determine what layer(s) the link segment type is to be registered on- Returns:
- created link segment type per layer if available
-
createOsmWaterWayLinkSegmentType
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createOsmWaterWayLinkSegmentType(String waterwayValue, double maxSpeed, Collection<? extends Mode> modes)
Create a link segment type on the network based on the passed in OSM waterway route value tags- Parameters:
waterwayValue
- of OSM way keymaxSpeed
- to utilise for this osm typemodes
- planit modes that determine what layer(s) the link segment type is to be registered on- Returns:
- created link segment type per layer if available
-
createOsmLinkSegmentType
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createOsmLinkSegmentType(String externalId, double capacityPcuPerhour, double maxDensityPcuPerKm, double maxSpeed, Collection<? extends Mode> modes)
Create OSM default link segment types with mode properties where we create multiple types if modes reside on different layers in which case only the modes on that layer will be added to the layer specific type- Parameters:
externalId
- of the typecapacityPcuPerhour
- capacity in pcu/hmaxDensityPcuPerKm
- max densitymaxSpeed
- the max speed (km/h)modes
- to identify layers to register link segment types on- Returns:
- link segment types per layer, if all modes are mapped to a single layer than the map only has a single entry, otherwise it might have more
-
createDefaultOsmLinkSegmentType
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createDefaultOsmLinkSegmentType(String nameKey, String nameValue, double capacityPcuPerhour, double maxSpeedKmh, Collection<? extends Mode> modes)
Create an OSM default link segment type with name (namekey=)namevalue- Parameters:
nameKey
- key component of name (may be null)nameValue
- component of the typecapacityPcuPerhour
- capacity in pcu/hmaxSpeedKmh
- of this typemodes
- to identify layers to register link segment types on- Returns:
- link segment types per layer, if all modes are mapped to a single layer than the map only has a single entry, otherwise it might have more
-
createMotorway
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createMotorway(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create motorway type with defaults restricted access major divided highway, normally with 2 or more running lanes plus emergency hard shoulder. Equivalent to the Freeway, Autobahn, etc..- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createMotorwayLink
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createMotorwayLink(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create motorway link type with defaults The link roads (sliproads/ramps) leading to/from a motorway from/to a motorway or lower class highway. Normally with the same motorway restrictions.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createTrunk
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createTrunk(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create trunk type with defaults The most important roads in a country's system that aren't motorways. (Need not necessarily be a divided highway.)- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createTrunkLink
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createTrunkLink(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create trunk link type with defaults restricted access major divided highway, normally with 2 or more running lanes plus emergency hard shoulder. Equivalent to the Freeway, Autobahn, etc..- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createPrimary
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createPrimary(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create primary type with defaults The next most important roads in a country's system (after trunk). (Often link larger towns.)- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createPrimaryLink
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createPrimaryLink(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create primary link type with defaults The link roads (sliproads/ramps) leading to/from a primary road from/to a primary road or lower class highway.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createSecondary
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createSecondary(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create secondary type with defaults The link roads (sliproads/ramps) leading to/from a primary road from/to a primary road or lower class highway.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createSecondaryLink
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createSecondaryLink(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create secondary link type with defaults The link roads (sliproads/ramps) leading to/from a secondary road from/to a secondary road or lower class highway.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createTertiary
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createTertiary(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create tertiary type with defaults The next most important roads in a country's system (after secondary). (Often link smaller towns and villages)- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createTertiaryLink
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createTertiaryLink(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create tertiary link type with defaults The link roads (sliproads/ramps) leading to/from a tertiary road from/to a tertiary road or lower class highway.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createUnclassified
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createUnclassified(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create unclassified type with defaults The least important through roads in a country's system – i.e. minor roads of a lower classification than tertiary, but which serve a purpose other than access to properties. (Often link villages and hamlets.)- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createResidential
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createResidential(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create residential type with defaults Roads which serve as an access to housing, without function of connecting settlements. Often lined with housing.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createLivingStreet
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createLivingStreet(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create living street type with defaults Roads which serve as an access to housing, without function of connecting settlements. Often lined with housing.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createService
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createService(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create service type with defaults For access roads to, or within an industrial estate, camp site, business park, car park, alleys, etc.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createPedestrian
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createPedestrian(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create pedestrian type with defaults For roads used mainly/exclusively for pedestrians in shopping and some residential areas which may allow access by motorised vehicles only for very limited periods of the day.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createPath
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createPath(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create path type with defaults A non-specific path either multi-use or unspecified usage, open to all non-motorized vehicles and not intended for motorized vehicles unless tagged so separately- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createSteps
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createSteps(double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create step type with defaults For flights of steps (stairs) on footways- Parameters:
osmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createFootway
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createFootway(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create footway type with defaults For designated footpaths; i.e., mainly/exclusively for pedestrians. This includes walking tracks and gravel paths.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createCycleway
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createCycleway(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create cycleway type with defaults For designated cycleways- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createBridleway
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createBridleway(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create bridleway type with defaults For horse riders.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createTrack
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createTrack(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create track type with defaults Roads for mostly agricultural or forestry uses.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createRoad
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createRoad(String osmKey, double osmHighwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create road type with defaults A road/way/street/motorway/etc. of unknown type. It can stand for anything ranging from a footpath to a motorway. This tag should only be used temporarily until the road/way/etc. has been properly surveyed.- Parameters:
osmKey
- used to prefix name because the type itself might not be unique without it, e.g., ferry=x, highway=xosmHighwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createFunicular
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createFunicular(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create funicular (rail) type with defaults- Parameters:
osmRailwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createLightRail
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createLightRail(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create light rail (rail) type with defaults- Parameters:
osmRailwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createMonoRail
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createMonoRail(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create mono rail (rail) type with defaults- Parameters:
osmRailwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createNarrowGauge
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createNarrowGauge(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create narrow gauge(rail) type with defaults- Parameters:
osmRailwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createRail
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createRail(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create rail type with defaults- Parameters:
osmRailwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createSubway
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createSubway(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create subway type with defaults- Parameters:
osmRailwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createTram
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createTram(double osmRailwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create tram type with defaults- Parameters:
osmRailwayTypeMaxSpeed
- speed limit of highway typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
createFerry
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createFerry(double osmwayTypeMaxSpeed, Collection<? extends Mode> modes)
Create ferry way type with defaults- Parameters:
osmwayTypeMaxSpeed
- speed limit of typemodes
- to identify layers to register link segment types on- Returns:
- created types per layer (depending on how modes are mapped to layers)
-
collectMappedPlanitModeTypes
protected Set<PredefinedModeType> collectMappedPlanitModeTypes(String osmWayLikeKey, String osmWayLikeValue, OsmNetworkReaderSettings settings)
collect the PLANit (predefined) mode types that are mapped, i.e., are marked to be activated in the final network.- Parameters:
osmWayLikeKey
- to collect forosmWayLikeValue
- to collect forsettings
- to collect from- Returns:
- mapped PLANit mode types, empty if no modes are mapped
-
createOsmCompatibleRoadLinkSegmentTypeByLayer
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createOsmCompatibleRoadLinkSegmentTypeByLayer(String osmWayValue, OsmNetworkReaderSettings settings)
create the road based link segment type based on the setting- Parameters:
osmWayValue
- to usesettings
- to extract defaults from- Returns:
- created (or already existing) default link segment type for the given OSM highway type per layer
-
createOsmCompatibleRailLinkSegmentTypeByLayer
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createOsmCompatibleRailLinkSegmentTypeByLayer(String osmWayValue, OsmNetworkReaderSettings settings)
create the rail based link segment type based on the setting- Parameters:
osmWayValue
- to usesettings
- to extract defaults from- Returns:
- created (or already existing) default link segment type per layer for the given OSM railway type
-
createOsmCompatibleWaterLinkSegmentTypeByLayer
protected Map<NetworkLayer,MacroscopicLinkSegmentType> createOsmCompatibleWaterLinkSegmentTypeByLayer(String osmWayValue, OsmNetworkReaderSettings settings)
create the water based link segment type based on the setting- Parameters:
osmWayValue
- to usesettings
- to extract defaults from- Returns:
- created (or already existing) default link segment type per layer for the given OSM water (route) type
-
getAvailableModesFromModeTypes
protected Set<PredefinedMode> getAvailableModesFromModeTypes(Collection<PredefinedModeType> predefinedModeTypes)
given predefined mode types, obtain the mode instances on the network that correspond to them- Parameters:
predefinedModeTypes
- to collect modes for- Returns:
- predefined mode types found
-
getDefaultLinkSegmentTypeByOsmTag
public Map<NetworkLayer,MacroscopicLinkSegmentType> getDefaultLinkSegmentTypeByOsmTag(String osmWayKey, String osmWayTypeTagValue)
Find the link segment type (per layer) by the Highway/railway/waterwayroute=value, where we pass in the "value"- Parameters:
osmWayKey
- to useosmWayTypeTagValue
- the type of road,rail,waterway to find- Returns:
- the link segment type that is registered per layer
-
createAndRegisterOsmCompatibleLinkSegmentTypes
public void createAndRegisterOsmCompatibleLinkSegmentTypes(OsmNetworkReaderSettings settings)
Create the link segment types that are marked in the passed in settings. As long as they have defaults that are supported, these will be created as indicated. If not available a warning is issued and a link segment type is created based on the default chosen in settings- Parameters:
settings
- to use
-
createAndRegisterOsmCompatiblePlanitPredefinedModes
public void createAndRegisterOsmCompatiblePlanitPredefinedModes(OsmNetworkReaderSettings settings)
Based on the settings we create instances of the activated OSM to PLANit mode mappings, for each created mode, append the OSM modes its represents as a list of semicolon separated entries- Parameters:
settings
- to extract information from
-
-