예제 #1
0
        public void ThenThesePlacemarksWillBeAssignedToTheFollowingClusters(Table table)
        {
            var folder = new KmlFolder(_placemarkTableRows.Select(x => new KmlPlacemark {
                Coordinates = new[] { new GeoCoordinate(x.Latitude, x.Longitude) },
                Name        = x.Name
            }));

            var kmlCalculator = new KmlCalculator();
            var resourceName  = new ResourceNameProvider();
            var factory       = new MooiClusterFactory(kmlCalculator, resourceName, new MooiPlacemarkFactory(kmlCalculator, resourceName));
            var clusters      = factory.CreateList(folder, null, string.Empty);
            var result        = clusters
                                .SelectMany((cluster, clusterIndex)
                                            => cluster.Placemarks.Select(placemark
                                                                         => new { p = placemark, i = clusterIndex }))
                                .Select(x => new PlacemarkInClusterTableRow {
                Name         = x.p.Name,
                ClusterIndex = x.i
            });

            table.CompareToSet(result);
        }
예제 #2
0
 public void TestInitialize()
 {
     _calculator = new KmlCalculator();
 }