• MARS Website
  • Core API
  • SmartOpenHamburg API
  • Model Components API
  • Common API
Show / Hide Table of Contents
  • Mars.Common
    • GeoHash
    • GeoHashDecoder
    • GeohashDecodeResult
    • GeoHashEncoder
    • GeoHashPrecision
    • Hyperrectangle
    • InputHashHelper
    • PositionHelper
  • Mars.Common.Collections
    • BinaryArrayHeap<T>
    • DoubleBits
    • FibonacciHeap<T, TKey>
    • FibonacciHeapDoubleKey<T>
    • FibonacciHeapNode<T, TKey>
    • FibonacciHeapNodeDoubleKey<T>
    • HeapNode
    • IntervalSize
    • K2DTree<T>
    • K2dTreeNode<T>
    • KdTree
    • KdTree<T>
    • KdTreeBase<TNode>
    • KdTreeNode
    • KdTreeNode<T>
    • KdTreeNodeBase<TNode>
    • KdTreeNodeCollection<TNode>
    • KdTreeNodeList<T>
    • Key
    • Node<T>
    • NodeBase<T>
    • NodeDataContainer<T>
    • NodeDistance<TNode>
    • QuadTree<T>
    • Root<T>
    • TreeDataContainer<T>
  • Mars.Common.Collections.CritBit
    • ICritBitTree<TValue>
  • Mars.Common.Collections.Graph
    • EdgeData
    • GraphData
    • GraphSerializer
    • ISpatialGraph
    • KeyContainer
    • NodeData
    • SpatialGraph
    • SpatialGraphHelper
  • Mars.Common.Collections.Graph.Algorithms
    • AStar
    • CompressedPathDatabase
    • ContractionSearch
    • DepthLimitedTraversal
  • Mars.Common.Collections.Graph.Helper
    • INodeFinder
    • KdTreeNodeFinder
    • RunLengthEncoder
  • Mars.Common.Collections.KNNGraph
    • DefaultRandomGenerator
    • DistanceUtils
    • EventSources
    • EventSources.GraphBuildEventSource
    • EventSources.GraphSearchEventSource
    • IProgressReporter
    • IProvideRandomValues
    • KnnGraph<TItem, TDistance>
    • KnnGraph<TItem, TDistance>.KnnSearchResult
    • KnnGraph<TItem, TDistance>.Parameters
    • Node
    • ReverseComparer<T>
    • ReverseComparerExtensions
    • SelectionKind
    • TravelingCosts<TItem, TDistance>
  • Mars.Common.Compat
    • FormatDecoderAttribute
    • FormatEncoderAttribute
    • FormatHandlerAttribute
    • IntegerAttribute
    • NegativeIntegerAttribute
    • NonnegativeIntegerAttribute
    • NonpositiveIntegerAttribute
    • PositiveIntegerAttribute
  • Mars.Common.Data
    • DomainDataImporter
  • Mars.Common.Data.Providers
    • AscDataProvider
    • GeoJsonFeatureCollectionConverter
    • GeoJsonFeatureConverter
    • GeoJsonHelper
    • GeometryDataProvider
    • GraphMlProvider
    • HttpDataProvider
    • IDataProvider<TInput>
    • JsonFileDataProvider
    • JsonTextDataProvider
    • XmlFileDataProvider
    • XmlTextDataProvider
  • Mars.Common.Exceptions
    • DimensionMismatchException
    • ParseException
  • Mars.Common.IO
    • ExtensionMethods
    • FileClientUtils
    • FileKeys
    • HttpClientUtils
    • ObjectSerialize
    • Serializer
    • SerializerCompression
    • SparseFormat
    • SparseReader
    • SparseWriter
  • Mars.Common.IO.Attributes
    • SerializationBinderAttribute
    • SurrogateSelectorAttribute
  • Mars.Common.IO.Console
    • ChildProgressBar
    • IProgressBar
    • ProgressBar
    • ProgressBarBase
    • ProgressBarHeight
    • ProgressBarOptions
    • ProgressBarSimple
  • Mars.Common.IO.Csv
    • CsvAnalyzer
    • CsvReader
    • CsvReader.RecordEnumerator
    • CsvWriter
    • MissingFieldAction
    • ParseErrorAction
    • ValueTrimmingOptions
  • Mars.Common.IO.Events
    • ParseErrorEventArgs
  • Mars.Common.IO.Exceptions
    • MalformedCsvException
    • MissingFieldCsvException
  • Mars.Common.IO.Mapped
    • Context
    • DefaultArrayFactory
    • Extensions
    • IArrayFactory
    • ISerializableToStream
    • MappedAccessor<T>
    • MemoryMap
    • MemoryMap.CreateAccessorFunc<T>
    • MemoryMap.ReadFromDelegate<T>
    • MemoryMap.WriteToDelegate<T>
    • MemoryMapDelegates
    • MemoryMapDelegates.CreateAccessorFunc<T>
    • MemoryMapStream
  • Mars.Common.IO.Mapped.Accessors
    • MappedAccessorByte
    • MappedAccessorDouble
    • MappedAccessorInt16
    • MappedAccessorInt32
    • MappedAccessorInt64
    • MappedAccessorSingle
    • MappedAccessorUInt16
    • MappedAccessorUInt32
    • MappedAccessorUInt64
    • MappedAccessorVariable<T>
  • Mars.Common.IO.Mapped.Arrays
    • Array<T>
    • ArrayBase<T>
    • ArrayProfile
    • MappedArray<TMapped, T>
    • MappedArray<TMapped, T>.MapFrom
    • MappedArray<TMapped, T>.MapTo
    • MemoryArray<T>
    • VariableArray<T>
  • Mars.Common.IO.Mapped.Collections
    • MemoryBackedDictionary<TKey, TValue>
    • MemoryBackedList<T>
  • Mars.Common.IO.Mapped.Indexes
    • Index<T>
  • Mars.Common.IO.Mapped.Streams
    • CappedStream
  • Mars.Common.Socket
    • ByteOrder
    • CloseEventArgs
    • CloseStatusCode
    • CompressionMethod
    • ErrorEventArgs
    • Ext
    • MessageEventArgs
    • WebSocket
    • WebSocketException
    • WebSocketState
  • Mars.Common.Socket.Server
    • IWebSocketSession
    • WebHeaderCollection
    • WebSocketBehavior
    • WebSocketContext
    • WebSocketServer
    • WebSocketServiceHost
    • WebSocketServiceManager
    • WebSocketSessionManager
  • Mars.Numerics
    • Classes
    • Combinatorics
    • Constants
    • Distance
    • Elementwise
    • Jagged
    • MathematicsException
    • MathHelper
    • Matrix
    • MatrixOrder
    • MatrixType
    • Norm
    • Sort
    • Sorting
    • Sparse
    • Sparse<T>
    • Tools
    • Vector
    • VectorHelper
    • VectorType
  • Mars.Numerics.Comparers
    • ArrayComparer<T>
    • ComparerDirection
    • CustomComparer<T>
    • ElementComparer
    • ElementComparer<T>
    • GeneralComparer
    • StableComparer<T>
  • Mars.Numerics.Distances
    • Angular
    • Chebyshev
    • Cosine
    • Dirac<T>
    • Euclidean
    • Hamming
    • Hamming<T>
    • Haversine
    • Jaccard
    • Jaccard<T>
    • Kulczynski
    • Levenshtein
    • Levenshtein<T>
    • Manhattan
    • Matching
    • Minkowski
    • SquareEuclidean
    • Vincenty
    • Vincenty.Ellipsoid
  • Mars.Numerics.Distances.Base
    • IDistance<T>
    • IDistance<TFirst, TSecond>
    • IMetric<T>
    • ISimilarity<T, TU>
    • ISimilarity<T>
  • Mars.Numerics.Exceptions
    • DimensionMismatchException
    • NonPositiveDefiniteMatrixException
    • SingularMatrixException
  • Mars.Numerics.Formats
    • DefaultMatrixFormatProvider
    • IMatrixFormatProvider
    • MatrixFormatProviderBase
    • MatrixFormatter
    • OctaveMatrixFormatProvider
  • Mars.Numerics.Ranges
    • ByteRange
    • DoubleRange
    • FloatRange
    • IntRange
    • IRange<T>
  • Mars.Numerics.Statistics
    • ConstValueDistribution<T>
    • Distribution<T>
    • FastGaussianDistributionD
    • FastGaussianDistributionF
    • IDistribution
    • UniformDiscreteDistribution
    • UniformDistributionD
    • UniformDistributionF
  • Mars.Numerics.Statistics.Base
    • BinarySearch
    • DistributionBase
    • ISampleableDistribution<TObservations>
    • IUnivariateDistribution
    • IUnivariateDistribution<TObservation>
    • UnivariateDiscreteDistribution

Class SpatialGraph

This graph holds edges and nodes by their keys for fast import, export and access.
Inheritance
System.Object
SpatialGraph
Implements
ISpatialGraph
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Common.Collections.Graph
Assembly: Mars.Common.dll
Syntax
[MessagePackObject(true)]
public class SpatialGraph : ISpatialGraph

Constructors

| Improve this Doc View Source

SpatialGraph()

Standard constructor for deserialize purposes.
Declaration
public SpatialGraph()
| Improve this Doc View Source

SpatialGraph(Input)

Creates a new SpatialGraph from a concrete import source.
Declaration
public SpatialGraph(Input import)
Parameters
Type Name Description
Input import The graph data source to import.
| Improve this Doc View Source

SpatialGraph(SpatialGraphOptions)

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
public SpatialGraph(SpatialGraphOptions imports)
Parameters
Type Name Description
SpatialGraphOptions imports
| Improve this Doc View Source

SpatialGraph(IReadOnlyCollection<Input>)

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
public SpatialGraph(IReadOnlyCollection<Input> imports)
Parameters
Type Name Description
System.Collections.Generic.IReadOnlyCollection<Input> imports
| Improve this Doc View Source

SpatialGraph(Nullable<Double>, String, Boolean)

Import a network file into the SpatialGraph structure.
Declaration
public SpatialGraph(double? nodeTolerance, string value, bool bidirectional = false)
Parameters
Type Name Description
System.Nullable<System.Double> nodeTolerance Slower init methodology that allows to find nodes in a tolerance distance.
System.String value The value to load into the network.
System.Boolean bidirectional Flag to import each edge in both direction.
| Improve this Doc View Source

SpatialGraph(String, Nullable<Double>, Boolean)

Import a network file into the SpatialGraph structure.
Declaration
public SpatialGraph(string file, double? nodeTolerance = null, bool bidirectional = false)
Parameters
Type Name Description
System.String file The file path to the network file.
System.Nullable<System.Double> nodeTolerance Slower init methodology that allows to find nodes in a tolerance distance.
System.Boolean bidirectional Flag to import each edge in both direction.

Properties

| Improve this Doc View Source

BoundingBox

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
public BoundingBox BoundingBox { get; set; }
Property Value
Type Description
BoundingBox
| Improve this Doc View Source

Edges

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
public IDictionary<int, EdgeData> Edges { get; set; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Int32, EdgeData>
| Improve this Doc View Source

EdgesMap

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
public IDictionary<(int, int), HashSet<int>> EdgesMap { get; set; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.ValueTuple<System.Int32, System.Int32>, System.Collections.Generic.HashSet<System.Int32>>
| Improve this Doc View Source

Features

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
[IgnoreMember]
public FeatureCollection Features { get; }
Property Value
Type Description
NetTopologySuite.Features.FeatureCollection
| Improve this Doc View Source

KeyHelper

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
public KeyContainer KeyHelper { get; set; }
Property Value
Type Description
KeyContainer
| Improve this Doc View Source

Metric

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
[IgnoreMember]
public IMetric<double[]> Metric { get; set; }
Property Value
Type Description
IMetric<System.Double[]>
| Improve this Doc View Source

NodeOrdering

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
public IDictionary<int, int> NodeOrdering { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Int32, System.Int32>
| Improve this Doc View Source

NodesMap

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
public IDictionary<int, NodeData> NodesMap { get; set; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Int32, NodeData>

Methods

| Improve this Doc View Source

AddContractionLayer(IEnumerable<NodeData>)

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
public void AddContractionLayer(IEnumerable<NodeData> nodeOrder = null)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<NodeData> nodeOrder
| Improve this Doc View Source

AddEdge(NodeData, NodeData, IDictionary<String, Object>, Geometry, Double, Int32[], Boolean, IList<Int32>)

Create a new edge and add references in the affected nodes
Declaration
public EdgeData AddEdge(NodeData origin, NodeData destination, IDictionary<string, object> attributes = null, Geometry line = null, double distance = -1, int[] restrictions = null, bool isHelperEdge = false, IList<int> shortcutPath = null)
Parameters
Type Name Description
NodeData origin the node where the edge starts
NodeData destination the node where the edge ends
System.Collections.Generic.IDictionary<System.String, System.Object> attributes All associated data to this edge e.g., the amount of lanes the length or maximum speed constraints.
NetTopologySuite.Geometries.Geometry line The LineString geometry to represent curves and lines.
System.Double distance The whole distance of this edge.
System.Int32[] restrictions The collection restricting keys only able to route along this edge.
System.Boolean isHelperEdge This flag describes whether the SpatialGraph has created this edge or not.
System.Collections.Generic.IList<System.Int32> shortcutPath A shortcut path connecting the with over multiple nodes directly.
Returns
Type Description
EdgeData the newly created edge
| Improve this Doc View Source

AddEdge(Int32, Int32, IDictionary<String, Object>)

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
public EdgeData AddEdge(int originKey, int destinationKey, IDictionary<string, object> attributes = null)
Parameters
Type Name Description
System.Int32 originKey
System.Int32 destinationKey
System.Collections.Generic.IDictionary<System.String, System.Object> attributes
Returns
Type Description
EdgeData
| Improve this Doc View Source

AddNode(IDictionary<String, Object>)

Creates a new NodeData object with default spatial reference and adds it to the graph model.
Declaration
public NodeData AddNode(IDictionary<string, object> attributes = null)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.String, System.Object> attributes The optional data collection.
Returns
Type Description
NodeData the newly created node
| Improve this Doc View Source

AddNode(Double, Double, IDictionary<String, Object>, Boolean)

Creates a new NodeData object with spatial reference and adds it to the graph model.
Declaration
public NodeData AddNode(double x, double y, IDictionary<string, object> attributes = null, bool isHelperNode = false)
Parameters
Type Name Description
System.Double x The x coordinate of the spatial reference.
System.Double y The y coordinate of the spatial reference.
System.Collections.Generic.IDictionary<System.String, System.Object> attributes The optional data collection.
System.Boolean isHelperNode The node was created by the spatial graph itself.
Returns
Type Description
NodeData Returns a new NodeData object with spatial reference.
| Improve this Doc View Source

RemoveEdge(Int32)

This graph holds edges and nodes by their keys for fast import, export and access.
Declaration
public void RemoveEdge(int edgeIndex)
Parameters
Type Name Description
System.Int32 edgeIndex
| Improve this Doc View Source

RemoveNode(NodeData)

Removes a node and deletes all edges which are affected by this change
Declaration
public void RemoveNode(NodeData node)
Parameters
Type Name Description
NodeData node the node to be deleted

Implements

ISpatialGraph

Extension Methods

AStar.AStarAlgorithm(SpatialGraph, Int32, Int32, Func<EdgeData, NodeData, Double>)
AStar.AStarNextNodeIndices(SpatialGraph, Int32, Int32, Func<EdgeData, NodeData, Double>)
AStar.AStarPathAlgorithm(SpatialGraph, Int32, Int32, Func<EdgeData, NodeData, Double>)
ContractionSearch.BidirectionalContractionSearch(SpatialGraph, Int32, Int32, Func<EdgeData, Double>, out IDictionary<Int32, Int32>)
DepthLimitedTraversal.Traverse(SpatialGraph, Int32, Action<NodeData>, Int32)
GraphSerializer.SerializeGraph(SpatialGraph)
GraphSerializer.SerializeGraph(SpatialGraph, Stream)
GraphSerializer.ToGeoJson(SpatialGraph)
Serializer.Save<T>(T, out Byte[], SerializerCompression)
Serializer.Save<T>(T, Stream, SerializerCompression)
Serializer.Save<T>(T, BinaryFormatter, Stream, SerializerCompression)
Serializer.Save<T>(T, String, SerializerCompression)
Serializer.Save<T>(T, String)
Matrix.Concatenate<T>(T, T[])
Matrix.Replace<T>(T, Object, Object)
DomainDataImporter.Import(Object, InputConfiguration)
ObjectSerialize.Serialize(Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © MARS GROUP. HAW Hamburg