Mercurial > gemma
changeset 4637:0ed1489af8b6
Removed ST_MakeValid from inserting sounding results and differences ... in hope that they are not broken.
This speeds inserting up a lot.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 11 Oct 2019 15:09:13 +0200 |
parents | a08e0c8c53ee |
children | 2e19ed576c68 |
files | pkg/controllers/diff.go pkg/imports/sr.go |
diffstat | 2 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/pkg/controllers/diff.go Fri Oct 11 14:12:05 2019 +0200 +++ b/pkg/controllers/diff.go Fri Oct 11 15:09:13 2019 +0200 @@ -76,8 +76,7 @@ ST_Multi( ST_CollectionExtract( ST_SimplifyPreserveTopology( - ST_Multi(ST_Collectionextract( - ST_MakeValid(ST_GeomFromWKB($4, $3::integer)), 3)), + ST_GeomFromWKB($4, $3::integer), $5 ), 3
--- a/pkg/imports/sr.go Fri Oct 11 14:12:05 2019 +0200 +++ b/pkg/imports/sr.go Fri Oct 11 15:09:13 2019 +0200 @@ -176,8 +176,7 @@ ST_Multi( ST_CollectionExtract( ST_SimplifyPreserveTopology( - ST_Multi(ST_Collectionextract( - ST_MakeValid(ST_GeomFromWKB($4, $3::integer)), 3)), + ST_GeomFromWKB($4, $3::integer), $5 ), 3 @@ -911,19 +910,26 @@ } defer stmt.Close() + var size int + for i, a := range areas { if len(a) == 0 { continue } + wkb := a.AsWKB() + size += len(wkb) if _, err := stmt.ExecContext( ctx, id, heights[i], epsg, - a.AsWKB(), + wkb, contourTolerance, ); err != nil { return err } } + feedback.Info("Transfered WKB size: %.2fMB.", + float64(size)/(1024*1024)) + return nil }