Mercurial > gemma
comparison pkg/imports/sr.go @ 4171:5a650cde0574
Move warning limiter to common package to flesh up the misc package.
The remaining stuff in misc has dependencies to the config
and cannot be removed from there easily w/o introducing
cyclic imports. I have to rethink this.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 05 Aug 2019 16:43:31 +0200 |
parents | 98e2041c7ebf |
children | 8b75ac5e243e |
comparison
equal
deleted
inserted
replaced
4170:afabd52212d2 | 4171:5a650cde0574 |
---|---|
33 "time" | 33 "time" |
34 | 34 |
35 shp "github.com/jonas-p/go-shp" | 35 shp "github.com/jonas-p/go-shp" |
36 | 36 |
37 "gemma.intevation.de/gemma/pkg/common" | 37 "gemma.intevation.de/gemma/pkg/common" |
38 "gemma.intevation.de/gemma/pkg/misc" | |
39 "gemma.intevation.de/gemma/pkg/models" | 38 "gemma.intevation.de/gemma/pkg/models" |
40 "gemma.intevation.de/gemma/pkg/octree" | 39 "gemma.intevation.de/gemma/pkg/octree" |
41 ) | 40 ) |
42 | 41 |
43 // SoundingResult is a Job to import sounding reults | 42 // SoundingResult is a Job to import sounding reults |
731 | 730 |
732 func loadXYZReader(r io.Reader, feedback Feedback, xform vertexTransform) (octree.MultiPointZ, error) { | 731 func loadXYZReader(r io.Reader, feedback Feedback, xform vertexTransform) (octree.MultiPointZ, error) { |
733 mpz := make(octree.MultiPointZ, 0, 250000) | 732 mpz := make(octree.MultiPointZ, 0, 250000) |
734 s := bufio.NewScanner(r) | 733 s := bufio.NewScanner(r) |
735 | 734 |
736 warnLimiter := misc.WarningLimiter{Log: feedback.Warn, MaxWarnings: 100} | 735 warnLimiter := common.WarningLimiter{Log: feedback.Warn, MaxWarnings: 100} |
737 warn := warnLimiter.Warn | 736 warn := warnLimiter.Warn |
738 defer warnLimiter.Close() | 737 defer warnLimiter.Close() |
739 | 738 |
740 for line := 1; s.Scan(); line++ { | 739 for line := 1; s.Scan(); line++ { |
741 text := s.Text() | 740 text := s.Text() |