# HG changeset patch # User Sascha L. Teichmann # Date 1548073226 -3600 # Node ID ec7360afd5e17235d9bca3c0fe922d1ec4dd181b # Parent 1aa2921d88321f8aae84e10b190b1bc733474736 Fairway dimension import: Dont break if there are features outside the responsibility areas. diff -r 1aa2921d8832 -r ec7360afd5e1 pkg/imports/fd.go --- a/pkg/imports/fd.go Mon Jan 21 13:02:32 2019 +0100 +++ b/pkg/imports/fd.go Mon Jan 21 13:20:26 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)