diff pkg/imports/sr.go @ 1131:2e6b47cdb2ca

Store octrees along with sounding results The extra table with 1:1-relation to sounding results was a provisorial solution with the intention to make it easily removable.
author Tom Gottfried <tom@intevation.de>
date Wed, 07 Nov 2018 17:54:50 +0100
parents 42617bba8709
children a5069da2f0b7
line wrap: on
line diff
--- a/pkg/imports/sr.go	Wed Nov 07 17:54:31 2018 +0100
+++ b/pkg/imports/sr.go	Wed Nov 07 17:54:50 2018 +0100
@@ -103,15 +103,9 @@
   END + floor((ST_X(ST_Centroid(point_cloud::geometry))+180)/6)::int + 1`
 
 	insertOctreeSQL = `
-INSERT INTO waterway.octrees (
-  sounding_result_id,
-  checksum,
-  octree_index
-) VALUES (
-  $1,
-  $2,
-  $3
-)`
+UPDATE waterway.sounding_results SET
+  octree_checksum = $2, octree_index = $3
+WHERE id = $1`
 
 	insertContourSQL = `
 INSERT INTO waterway.sounding_results_contour_lines (