예제 #1
0
        public static IList <RoadNetwork> BuildNetworks(RoadTopology topology)
        {
            topology.AlignOrientation();
            var edgeSegments = BuildEdgeSegments(topology);

            InsertNodeSegments(topology, edgeSegments);
            var networks = BuildNetworks(topology, edgeSegments);

            return(networks);
        }
예제 #2
0
        public static IEnumerable <RoadNetwork> BuildNetworks(RoadTopology topology, RoadTemplateList roadTemplateList)
        {
            topology.AlignOrientation();
            var edgeSegments = BuildEdgeSegments(topology);

            InsertNodeSegments(topology, edgeSegments);
            InsertEndCapSegments(edgeSegments, roadTemplateList);
            var networks = BuildNetworks(topology, edgeSegments);

            // sort networks in the order specified by roadTemplateList
            var sortedNetworks = roadTemplateList
                                 .Join(
                networks,
                t => t.InstanceId,
                n => n.Template.InstanceId,
                (t, n) => n);

            return(sortedNetworks);
        }