Mercurial > gemma
changeset 1937:1fb28aef26b2
merge
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Mon, 21 Jan 2019 15:18:10 +0100 |
parents | 73f9e15d0384 (diff) 17b6d2a6fb76 (current diff) |
children | 148917b4f859 |
files | |
diffstat | 2 files changed, 15 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/pkg/imports/fd.go Mon Jan 21 15:17:52 2019 +0100 +++ b/pkg/imports/fd.go Mon Jan 21 15:18:10 2019 +0100 @@ -215,6 +215,7 @@ missingProperties int badProperties int features int + outside int fds []fdSummary ) @@ -238,6 +239,7 @@ feedback.Info("Using EPSG: %d", epsg) + features: for _, feature := range rfc.Features { if feature.Geometry.Coordinates == nil { missingProperties++ @@ -258,7 +260,7 @@ } var fdid int64 var lat, lon float64 - if err := insertStmt.QueryRowContext( + err = insertStmt.QueryRowContext( ctx, p.asWKB(), epsg, @@ -268,8 +270,13 @@ fd.Depth, props.HydroSorDat.Time, fd.SourceOrganization, - ).Scan(&fdid, &lat, &lon); err != nil { - feedback.Error("error: %s", err) + ).Scan(&fdid, &lat, &lon) + switch { + case err == sql.ErrNoRows: + outside++ + // ignore -> filtered by responsibility_areas + continue features + case err != nil: return err } // Store for potential later removal. @@ -301,6 +308,10 @@ feedback.Warn("Unsupported types found: %s", unsupported) } + if outside > 0 { + feedback.Info("Features outside responsibility areas: %d", outside) + } + if features == 0 { err := errors.New("No features found") feedback.Error("%v", err)
--- a/pkg/wfs/download.go Mon Jan 21 15:17:52 2019 +0100 +++ b/pkg/wfs/download.go Mon Jan 21 15:18:10 2019 +0100 @@ -264,7 +264,7 @@ func DownloadURLs(urls []string, handler func(io.Reader) error) error { for _, url := range urls { if err := downloadURL(url, handler); err != nil { - return nil + return err } } return nil