public void TestTopgisTMultiPatches() { IWorkspace workspace = TestDataUtils.OpenTopgisTlm(); IFeatureClass gebaeude = ((IFeatureWorkspace)workspace).OpenFeatureClass( "TOPGIS_TLM.TLM_GEBAEUDE"); var test = new QaMpVertexNotNearFace( gebaeude, new[] { gebaeude }, 1, 0.2); test.VerifyWithinFeature = true; test.PointCoincidence = 0.1; test.EdgeCoincidence = 0.1; test.IgnoreNonCoplanarFaces = true; test.MinimumSlopeDegrees = 15; var runner = new QaContainerTestRunner(10000, test); runner.LogErrors = false; IFeatureWorkspace ws = TestWorkspaceUtils.CreateTestFgdbWorkspace("QaMpVertexNotNearFaceTest"); var logger = new SimpleErrorWorkspace(ws); runner.TestContainer.QaError += logger.TestContainer_QaError; runner.Execute(); Console.WriteLine(runner.Errors.Count); }
public void CanCheckEinzelbaum() { IWorkspace topgis = TestDataUtils.OpenTopgisTlm(); ITable table = ((IFeatureWorkspace)topgis).OpenTable("TOPGIS_TLM.TLM_EINZELBAUM_GEBUESCH"); IFeatureWorkspace local = WorkspaceUtils.OpenFileGdbFeatureWorkspace( @"c:\data\unitTests\felix\testdata.gdb"); ITable table2 = local.OpenTable("TLM_EINZELBAUM_GEBUESCH"); //var test = new QaUnique(new[] { table, table2 }, new[] { "OBJECTID,UUID", "OID_COPY,UUID" }); var test = new QaUnique(new[] { table2, table }, new[] { "Uuid,Oid_COPY", "UUID,OBJECTID" }); test.SetConstraint(0, "OBJECTID < 1052400"); test.SetConstraint(1, "OBJECTID < 1052400"); var runner = new QaTestRunner(test); runner.Execute(); }
public void PerformanceTest() { var ws = (IFeatureWorkspace)TestDataUtils.OpenTopgisTlm(); IFeatureClass ptFc = ws.OpenFeatureClass("TOPGIS_TLM.TLM_EINZELBAUM_GEBUESCH"); IFeatureClass polyFc = ws.OpenFeatureClass("TOPGIS_TLM.TLM_BODENBEDECKUNG"); var test = new QaPointNotNear(ptFc, polyFc, 2); test.SetConstraint(1, "Objektart = 12"); // wald double tileSize = 10000; var runner = new QaContainerTestRunner(tileSize, test); IEnvelope testBox = GeometryFactory.CreateEnvelope(2554000, 1147000, 2561000, 1151000); var w = new Stopwatch(); w.Start(); runner.Execute(testBox); w.Stop(); string msg = $"Direct:{w.ElapsedMilliseconds} ms"; Console.WriteLine(msg); int nDirect = runner.Errors.Count; QaPointNotNear.UseQueryPointAndDistance = true; runner.ClearErrors(); w.Reset(); w.Start(); runner.Execute(testBox); w.Stop(); msg = $"QueryDistance:{w.ElapsedMilliseconds} ms"; Console.WriteLine(msg); int nQuery = runner.Errors.Count; QaPointNotNear.UseQueryPointAndDistance = false; Assert.AreEqual(nQuery, nDirect); }
public void TestTopgisTMultiPatches() { IWorkspace workspace = TestDataUtils.OpenTopgisTlm(); IFeatureClass gebaeude = ((IFeatureWorkspace)workspace).OpenFeatureClass( "TOPGIS_TLM.TLM_GEBAEUDE"); var tests = new ITest[] { // new QaSegmentLength(gebaeude, 0.1), // new QaSliverPolygon(gebaeude, 50), // new QaCoplanarRings(gebaeude, 0, false), new QaMpFootprintHoles(gebaeude, InnerRingHandling.IgnoreInnerRings) }; var runner = new QaContainerTestRunner(10000, tests); runner.LogErrors = false; runner.Execute(); Console.WriteLine(runner.Errors.Count); }
public void MultiPointPerformanceTest() { IWorkspace ws = TestDataUtils.OpenTopgisTlm(); IFeatureClass mpFc = ((IFeatureWorkspace)ws).OpenFeatureClass("TOPGIS_TLM.TLM_DTM_MASSENPUNKTE"); var watch = new Stopwatch(); WKSPointVA[] sourcePointsArray = null; watch.Start(); long sumArray = 0; long sumSingle = 0; long sumPoints = 0; int limit = 1000 * 120; var featureCount = 0; foreach (IFeature feature in new EnumCursor((ITable)mpFc, null, recycle: true)) { var points = (IPointCollection5)feature.Shape; int pointCount = points.PointCount; sumPoints += pointCount; // Console.WriteLine(pointCount); if (sourcePointsArray == null || sourcePointsArray.Length < points.PointCount) { const int margin = 2000; sourcePointsArray = new WKSPointVA[pointCount + margin]; } long start = watch.ElapsedTicks; double sumMArray = 0; points.QueryWKSPointVA(0, pointCount, out sourcePointsArray[0]); for (var i = 0; i < pointCount; i++) { double currentM = sourcePointsArray[i].m_m; sumMArray += currentM; } long stop = watch.ElapsedTicks; sumArray += stop - start; double sumMSingle = 0; start = watch.ElapsedTicks; for (var i = 0; i < pointCount; i++) { WKSPointVA currentPoint; points.QueryWKSPointVA(i, 1, out currentPoint); double currentM = currentPoint.m_m; sumMSingle += currentM; } stop = watch.ElapsedTicks; sumSingle += stop - start; Assert.AreEqual(sumMArray, sumMSingle); featureCount++; if (watch.ElapsedMilliseconds > limit) { break; } } Console.WriteLine(string.Format("Points: " + sumPoints)); Console.WriteLine(string.Format("Array Tics: " + sumArray)); Console.WriteLine(string.Format("Single Tics:" + sumSingle)); }