Mercurial > gemma
changeset 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 | 8b85032ed3cd |
children | 46440355dd7c |
files | pkg/imports/sr.go |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
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 }