Mercurial > gemma
diff pkg/controllers/diff.go @ 4578:c657dec6b0fa iso-areas
Removed old contours from backend and database.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 08 Oct 2019 12:10:55 +0200 |
parents | daed8a92024a |
children | 0ed1489af8b6 |
line wrap: on
line diff
--- a/pkg/controllers/diff.go Tue Oct 08 10:37:02 2019 +0200 +++ b/pkg/controllers/diff.go Tue Oct 08 12:10:55 2019 +0200 @@ -63,29 +63,6 @@ WHERE m.date_info = $2::date AND s.date_info = $3::date RETURNING id ` - insertDiffContourSQL = ` -INSERT INTO caching.sounding_differences_contour_lines ( - sounding_differences_id, - height, - lines -) -SELECT - $5, - $4, - ST_Transform( - ST_Multi( - ST_CollectionExtract( - ST_SimplifyPreserveTopology( - ST_Multi(ST_Collectionextract( - ST_MakeValid(ST_GeomFromWKB($1, $2::integer)), 2)), - $3 - ), - 2 - ) - ), - 4326 - ) -` insertDiffIsoAreasQL = ` INSERT INTO caching.sounding_differences_iso_areas ( sounding_differences_id, @@ -302,12 +279,6 @@ log.Printf("info: num heights: %d\n", len(heights)) - var stmt *sql.Stmt - if stmt, err = tx.PrepareContext(ctx, insertDiffContourSQL); err != nil { - return - } - defer stmt.Close() - var isoStmt *sql.Stmt if isoStmt, err = tx.PrepareContext(ctx, insertDiffIsoAreasQL); err != nil { return @@ -326,19 +297,6 @@ heights = common.DedupFloat64s(heights) - octree.DoContours(tree, heights, func(res *octree.ContourResult) { - if err == nil && len(res.Lines) > 0 { - _, err = stmt.ExecContext( - ctx, - res.Lines.AsWKB2D(), - minuendTree.EPSG, - contourTolerance, - res.Height, - id, - ) - } - }) - areas := tree.TraceAreas(heights, isoCellSize) for i, a := range areas {