diff pkg/controllers/diff.go @ 2572:7686c7c23506

Morphological differences: Moved some code into octree package.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 11 Mar 2019 14:00:49 +0100
parents c4242b9d59fe
children 2833ff156cb2
line wrap: on
line diff
--- a/pkg/controllers/diff.go	Mon Mar 11 13:42:27 2019 +0100
+++ b/pkg/controllers/diff.go	Mon Mar 11 14:00:49 2019 +0100
@@ -89,6 +89,29 @@
 		return
 	}
 
+	// We need a slow path implementation for this.
+	if minuendTree.EPSG != subtrahendTree.EPSG {
+		err = JSONError{
+			Code: http.StatusInternalServerError,
+			Message: "Calculating differences between two different " +
+				"EPSG code octrees are not supported, yet.",
+		}
+		return
+	}
+
+	start = time.Now()
+	points := minuendTree.Diff(subtrahendTree)
+	log.Printf("info: A - B took %v\n", time.Since(start))
+
+	start = time.Now()
+	var tri *octree.Triangulation
+	if tri, err = points.Triangulate(); err != nil {
+		return
+	}
+	log.Printf("triangulation took %v\n", time.Since(start))
+
+	_ = tri
+
 	// TODO: Implement me!
 
 	return