Ejemplo n.º 1
0
 public Problems RoadSegmentMissing(RoadSegmentId segmentId)
 {
     return(new Problems(
                _problems.Add(
                    new Error(nameof(RoadSegmentMissing),
                              new ProblemParameter("SegmentId", segmentId.ToInt32().ToString())))
                ));
 }
Ejemplo n.º 2
0
        // Road Segment Errors

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

        public Problems RoadSegmentGeometryTaken(RoadSegmentId byOtherSegment)
        {
            return(new Problems(_problems.Add(
                                    new Error(
                                        nameof(RoadSegmentGeometryTaken),
                                        new ProblemParameter(
                                            "ByOtherSegment",
                                            byOtherSegment.ToInt32().ToString())))));
        }
Ejemplo n.º 3
0
 public Problems RoadNodeTooClose(RoadSegmentId toOtherSegment)
 {
     return(new Problems(_problems.Add(
                             new Error(
                                 nameof(RoadNodeTooClose),
                                 new ProblemParameter(
                                     "ToOtherSegment",
                                     toOtherSegment.ToInt32().ToString())))
                         ));
 }
Ejemplo n.º 4
0
 public Problems FakeRoadNodeConnectedSegmentsDoNotDiffer(RoadSegmentId segment1, RoadSegmentId segment2)
 {
     return(new Problems(
                _problems.Add(
                    new Error(nameof(FakeRoadNodeConnectedSegmentsDoNotDiffer),
                              new ProblemParameter(
                                  "SegmentId",
                                  segment1.ToInt32().ToString()),
                              new ProblemParameter(
                                  "SegmentId",
                                  segment2.ToInt32().ToString())))
                ));
 }
Ejemplo n.º 5
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()
     });
 }