Beispiel #1
0
        // Road Node Errors

        //public Errors RoadNodeIdTaken() => new Errors(_errors.Add(new Error(nameof(RoadNodeIdTaken))));

        public Problems RoadNodeGeometryTaken(RoadNodeId byOtherNode)
        {
            return(new Problems(_problems.Add(
                                    new Error(
                                        nameof(RoadNodeGeometryTaken),
                                        new ProblemParameter(
                                            "ByOtherNode",
                                            byOtherNode.ToInt32().ToString())))
                                ));
        }
Beispiel #2
0
 public Messages.RoadNetworkSnapshot TakeSnapshot()
 {
     return(new Messages.RoadNetworkSnapshot
     {
         Nodes = _nodes.Select(node => new Messages.RoadNetworkSnapshotNode
         {
             Id = node.Value.Id.ToInt32(),
             Segments = node.Value.Segments.Select(segment => segment.ToInt32()).ToArray(),
             Geometry = GeometryTranslator.Translate(node.Value.Geometry)
         }).ToArray(),
         Segments = _segments.Select(segment => new Messages.RoadNetworkSnapshotSegment
         {
             Id = segment.Value.Id.ToInt32(),
             StartNodeId = segment.Value.Start.ToInt32(),
             EndNodeId = segment.Value.End.ToInt32(),
             Geometry = GeometryTranslator.Translate(segment.Value.Geometry),
             AttributeHash = segment.Value.AttributeHash.GetHashCode()
         }).ToArray(),
         MaximumNodeId = _maximumNodeId.ToInt32(),
         MaximumSegmentId = _maximumSegmentId.ToInt32(),
         MaximumGradeSeparatedJunctionId = _maximumGradeSeparatedJunctionId.ToInt32(),
         MaximumEuropeanRoadAttributeId = _maximumEuropeanRoadAttributeId.ToInt32(),
         MaximumNationalRoadAttributeId = _maximumNationalRoadAttributeId.ToInt32(),
         MaximumNumberedRoadAttributeId = _maximumNumberedRoadAttributeId.ToInt32(),
         MaximumLaneAttributeId = _maximumLaneAttributeId.ToInt32(),
         MaximumWidthAttributeId = _maximumWidthAttributeId.ToInt32(),
         MaximumSurfaceAttributeId = _maximumSurfaceAttributeId.ToInt32(),
         SegmentReusableLaneAttributeIdentifiers = _segmentReusableLaneAttributeIdentifiers.Select(segment =>
                                                                                                   new Messages.RoadNetworkSnapshotSegmentReusableAttributeIdentifiers
         {
             SegmentId = segment.Key.ToInt32(),
             ReusableAttributeIdentifiers = segment.Value.Select(lane => lane.ToInt32()).ToArray()
         }).ToArray(),
         SegmentReusableWidthAttributeIdentifiers = _segmentReusableWidthAttributeIdentifiers.Select(segment =>
                                                                                                     new Messages.RoadNetworkSnapshotSegmentReusableAttributeIdentifiers
         {
             SegmentId = segment.Key.ToInt32(),
             ReusableAttributeIdentifiers = segment.Value.Select(width => width.ToInt32()).ToArray()
         }).ToArray(),
         SegmentReusableSurfaceAttributeIdentifiers = _segmentReusableSurfaceAttributeIdentifiers.Select(segment =>
                                                                                                         new Messages.RoadNetworkSnapshotSegmentReusableAttributeIdentifiers
         {
             SegmentId = segment.Key.ToInt32(),
             ReusableAttributeIdentifiers = segment.Value.Select(surface => surface.ToInt32()).ToArray()
         }).ToArray()
     });
 }