Class RouterDb
Represents a routing database.
Inheritance
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class RouterDb
Constructors
RouterDb(MemoryMap, RoutingNetworkProfile, Single)
Creates a new router database.
Declaration
public RouterDb(MemoryMap map, RoutingNetworkProfile profile, float maxEdgeDistance = 5000F)
Parameters
|
MemoryMap
map
|
|
RoutingNetworkProfile
profile
|
|
System.Single
maxEdgeDistance
|
RouterDb(MemoryMap, Single)
Creates a new router database.
Declaration
public RouterDb(MemoryMap map, float maxEdgeDistance = 5000F)
Parameters
|
MemoryMap
map
|
|
System.Single
maxEdgeDistance
|
RouterDb(RoutingNetwork, AttributesIndex, AttributesIndex, IAttributeCollection, Vehicle[])
Creates a new router database.
Declaration
public RouterDb(RoutingNetwork network, AttributesIndex profiles, AttributesIndex meta, IAttributeCollection dbMeta, params Vehicle[] supportedVehicles)
Parameters
|
RoutingNetwork
network
|
|
AttributesIndex
profiles
|
|
AttributesIndex
meta
|
|
IAttributeCollection
dbMeta
|
|
Vehicle[]
supportedVehicles
|
RouterDb(Single)
Creates a new router database.
Declaration
public RouterDb(float maxEdgeDistance = 5000F)
Parameters
|
System.Single
maxEdgeDistance
|
Properties
EdgeData
Gets or sets the edge data.
Declaration
public MetaCollectionDb EdgeData { get; }
Property Value
|
MetaCollectionDb
|
EdgeMeta
Returns the meta-data index.
Declaration
public AttributesIndex EdgeMeta { get; }
Property Value
|
AttributesIndex
|
EdgeProfiles
Returns the profiles index.
Declaration
public AttributesIndex EdgeProfiles { get; }
Property Value
|
AttributesIndex
|
Guid
Returns the guid for this db.
Declaration
public Guid Guid { get; }
Property Value
|
Guid
|
HasContracted
Returns true if there is at least one contracted version of the network.
Declaration
public bool HasContracted { get; }
Property Value
|
System.Boolean
|
HasRestrictions
Returns true if there are restrictions in this database.
Declaration
public bool HasRestrictions { get; }
Property Value
|
System.Boolean
|
HasShortcuts
Returns true if there are shortcuts in this database.
Declaration
public bool HasShortcuts { get; }
Property Value
|
System.Boolean
|
IsEmpty
Returns true if this router db is empty.
Declaration
public bool IsEmpty { get; }
Property Value
|
System.Boolean
|
Meta
Gets the meta-data collection.
Declaration
public IAttributeCollection Meta { get; }
Property Value
|
IAttributeCollection
|
Network
Returns the network.
Declaration
public RoutingNetwork Network { get; }
Property Value
|
RoutingNetwork
|
RestrictionDbs
Gets all restriction dbs.
Declaration
public IEnumerable<RestrictionsDbMeta> RestrictionDbs { get; }
Property Value
|
IEnumerable<RestrictionsDbMeta>
|
VertexData
Gets or sets the vertex data.
Declaration
public MetaCollectionDb VertexData { get; }
Property Value
|
MetaCollectionDb
|
VertexMeta
Returns the vertex meta-date index.
Declaration
public MappedAttributesIndex VertexMeta { get; }
Property Value
|
MappedAttributesIndex
|
Methods
AddContracted(Profile, ContractedDb)
Adds a contracted version of the routing network for the given profile.
Declaration
public void AddContracted(Profile profile, ContractedDb contracted)
Parameters
|
Profile
profile
|
|
ContractedDb
contracted
|
AddRestrictions(String, RestrictionsDb)
Adds the restrictions for the given vehicle type.
Declaration
public void AddRestrictions(string vehicleType, RestrictionsDb restrictions)
Parameters
|
System.String
vehicleType
|
|
RestrictionsDb
restrictions
|
AddShortcuts(String, ShortcutsDb)
Adds a shortcuts db.
Declaration
public void AddShortcuts(string name, ShortcutsDb shortcutsDb)
Parameters
|
System.String
name
|
|
ShortcutsDb
shortcutsDb
|
AddSupportedVehicle(Vehicle)
Adds a supported vehicle.
Declaration
public void AddSupportedVehicle(Vehicle vehicle)
Parameters
|
Vehicle
vehicle
|
Compress()
Compresses the network and rearranges all id's as needed.
Declaration
public void Compress()
Deserialize(Stream)
Deserializes a database from the given stream.
Declaration
public static RouterDb Deserialize(Stream stream)
Parameters
|
Stream
stream
|
Returns
|
RouterDb
|
Deserialize(Stream, RouterDbProfile)
Deserializes a database from the given stream.
Declaration
public static RouterDb Deserialize(Stream stream, RouterDbProfile profile)
Parameters
|
Stream
stream
|
|
RouterDbProfile
profile
|
Returns
|
RouterDb
|
DeserializeAndAddContracted(Stream)
Reads a contracted graph from the given stream and adds it to this db.
Declaration
public void DeserializeAndAddContracted(Stream stream)
Parameters
|
Stream
stream
|
DeserializeAndAddContracted(Stream, ContractedDbProfile)
Reads a contracted graph from the given stream and adds it to this db.
Declaration
public void DeserializeAndAddContracted(Stream stream, ContractedDbProfile profile)
Parameters
|
Stream
stream
|
|
ContractedDbProfile
profile
|
GetContractedProfiles()
Gets all the profiles that have contracted db's.
Declaration
public IEnumerable<string> GetContractedProfiles()
Returns
|
IEnumerable<System.String>
|
GetRestrictedVehicleTypes()
Gets the names of the restricted vehicle types.
Declaration
public IEnumerable<string> GetRestrictedVehicleTypes()
Returns
|
IEnumerable<System.String>
|
GetSupportedProfile(String)
Gets one of the supported vehicles.
Declaration
public Profile GetSupportedProfile(string profileName)
Parameters
|
System.String
profileName
|
Returns
|
Profile
|
GetSupportedProfiles()
Gets one of the supported profiles.
Declaration
public IEnumerable<Profile> GetSupportedProfiles()
Returns
|
IEnumerable<Profile>
|
GetSupportedVehicle(String)
Gets one of the supported vehicles.
Declaration
public Vehicle GetSupportedVehicle(string vehicleName)
Parameters
|
System.String
vehicleName
|
Returns
|
Vehicle
|
GetSupportedVehicles()
Gets all the supported vehicle.
Declaration
public IEnumerable<Vehicle> GetSupportedVehicles()
Returns
|
IEnumerable<Vehicle>
|
HasContractedFor(Profile)
Returns true if this routing db has a contracted version of the routing network for the given profile.
Declaration
public bool HasContractedFor(Profile profile)
Parameters
|
Profile
profile
|
Returns
|
System.Boolean
|
NewGuid()
Generates a new guid.
Declaration
public void NewGuid()
Remarks
To use then the network was changed externally and was already writting to disk before.
RemoveContracted(Profile)
Removes the contracted version of the routing network for the given profile.
Declaration
public bool RemoveContracted(Profile profile)
Parameters
|
Profile
profile
|
Returns
|
System.Boolean
|
RemoveRestrictions(String)
Removes the restrictions for the given vehicle type.
Declaration
public bool RemoveRestrictions(string vehicleType)
Parameters
|
System.String
vehicleType
|
Returns
|
System.Boolean
|
RemoveShortcuts(String)
Removes a shortcuts db.
Declaration
public bool RemoveShortcuts(string name)
Parameters
|
System.String
name
|
Returns
|
System.Boolean
|
Serialize(Stream)
Writes this database to the given stream.
Declaration
public long Serialize(Stream stream)
Parameters
|
Stream
stream
|
Returns
|
System.Int64
|
Serialize(Stream, Boolean)
Writes this database to the given stream.
Declaration
public long Serialize(Stream stream, bool toReadonly)
Parameters
|
Stream
stream
|
|
System.Boolean
toReadonly
|
Returns
|
System.Int64
|
SerializeContracted(Profile, Stream)
Writes the contracted graph for the given profile to the given stream.
Declaration
public long SerializeContracted(Profile profile, Stream stream)
Parameters
|
Profile
profile
|
|
Stream
stream
|
Returns
|
System.Int64
|
SupportProfile(String)
Returns true if the profile with the given name is supported.
Declaration
public bool SupportProfile(string profileName)
Parameters
|
System.String
profileName
|
Returns
|
System.Boolean
|
Supports(String)
Returns true if the given vehicle is supported.
Declaration
public bool Supports(string vehicleName)
Parameters
|
System.String
vehicleName
|
Returns
|
System.Boolean
|
TryGetContracted(Profile, out ContractedDb)
Tries to get a contracted version of the routing network for the given profile.
Declaration
public bool TryGetContracted(Profile profile, out ContractedDb contracted)
Parameters
|
Profile
profile
|
|
ContractedDb
contracted
|
Returns
|
System.Boolean
|
TryGetRestrictions(String, out RestrictionsDb)
Returns true if this routing db has a restriction db for the given vehicle type.
Declaration
public bool TryGetRestrictions(string vehicleType, out RestrictionsDb restrictions)
Parameters
|
System.String
vehicleType
|
|
RestrictionsDb
restrictions
|
Returns
|
System.Boolean
|
TryGetShortcuts(String, out ShortcutsDb)
Tries to get a shortcuts db.
Declaration
public bool TryGetShortcuts(string name, out ShortcutsDb shortcutsDb)
Parameters
|
System.String
name
|
|
ShortcutsDb
shortcutsDb
|
Returns
|
System.Boolean
|