diff pkg/imports/sr.go @ 1384:8d59457a5651

Sounding result import: Consider parameter override as complete even if there is no EPSG code. Use WGS84 in this case as a default.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 27 Nov 2018 14:55:48 +0100
parents 5bb1e3c1f364
children 0e1d89241cda
line wrap: on
line diff
--- a/pkg/imports/sr.go	Tue Nov 27 14:52:59 2018 +0100
+++ b/pkg/imports/sr.go	Tue Nov 27 14:55:48 2018 +0100
@@ -300,15 +300,22 @@
 }
 
 func (sr *SoundingResult) completeOverride() bool {
-	return sr.EPSG != nil && sr.Bottleneck != nil && sr.Date != nil && sr.DepthReference != nil
+	// sr.EPSG == nil -> WGS84
+	return sr.Bottleneck != nil && sr.Date != nil && sr.DepthReference != nil
 }
 
 func (sr *SoundingResult) loadMeta(f *zip.File) (*models.SoundingResultMeta, error) {
 	if f == nil {
+		var epsg uint
+		if sr.EPSG != nil {
+			epsg = *sr.EPSG
+		} else {
+			epsg = models.WGS84
+		}
 		return &models.SoundingResultMeta{
 			Date:           *sr.Date,
 			Bottleneck:     *sr.Bottleneck,
-			EPSG:           *sr.EPSG,
+			EPSG:           epsg,
 			DepthReference: *sr.DepthReference,
 		}, nil
 	}