Mercurial > gemma
diff pkg/imports/sr.go @ 4566:2c49a293f275 iso-areas
Fixed access problem for waterway_admins and sys_admins.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 03 Oct 2019 22:27:11 +0200 |
parents | 6b107d4e6810 |
children | 4b3a298b94f8 |
line wrap: on
line diff
--- a/pkg/imports/sr.go Thu Oct 03 20:59:41 2019 +0200 +++ b/pkg/imports/sr.go Thu Oct 03 22:27:11 2019 +0200 @@ -24,7 +24,6 @@ "errors" "fmt" "io" - "log" "math" "os" "path" @@ -193,6 +192,7 @@ FROM waterway.sounding_results sr WHERE id = $1 ` + insertIsoAreasSQL = ` INSERT INTO waterway.sounding_results_iso_areas ( sounding_result_id, @@ -1012,46 +1012,21 @@ // none raster coordinate system. a := make(wkb.MultiPolygonGeom, len(c)) - rXMin, rXMax := math.MaxFloat64, -math.MaxFloat64 - rYMin, rYMax := math.MaxFloat64, -math.MaxFloat64 - for i, pl := range c { shell := make(wkb.LinearRingGeom, len(pl)) for j, pt := range pl { - x := reprojX(pt.X) - y := reprojY(pt.Y) - - if x < rXMin { - rXMin = x - } - if y < rYMin { - rYMin = y - } - if x > rXMax { - rXMax = x - } - if y > rYMax { - rYMax = y - } - shell[j] = wkb.PointGeom{ - X: x, - Y: y, + X: reprojX(pt.X), + Y: reprojY(pt.Y), } } a[i] = wkb.PolygonGeom{shell} } - log.Printf("(%.2f, %.2f) - (%.2f, %.2f)\n", - rXMin, rYMin, rXMax, rYMax) - log.Printf("%.2f / %.2f\n", rXMax-rXMin, rYMax-rYMin) areas[hIdx] = a } } - log.Printf("[%.2f, %.2f] - [%.2f, %.2f]\n", - min.X, min.Y, max.X, max.Y) - for n := runtime.NumCPU(); n >= 1; n-- { wg.Add(1) go doContours() @@ -1090,8 +1065,6 @@ time.Since(total)) }() - log.Printf("EPSG: %d\n", epsg) - stmt, err := tx.PrepareContext(ctx, insertIsoAreasSQL) if err != nil { return err