Mercurial > gemma
comparison 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 |
comparison
equal
deleted
inserted
replaced
1382:8b85032ed3cd | 1384:8d59457a5651 |
---|---|
298 func (sr *SoundingResult) CleanUp() error { | 298 func (sr *SoundingResult) CleanUp() error { |
299 return os.RemoveAll(sr.Dir) | 299 return os.RemoveAll(sr.Dir) |
300 } | 300 } |
301 | 301 |
302 func (sr *SoundingResult) completeOverride() bool { | 302 func (sr *SoundingResult) completeOverride() bool { |
303 return sr.EPSG != nil && sr.Bottleneck != nil && sr.Date != nil && sr.DepthReference != nil | 303 // sr.EPSG == nil -> WGS84 |
304 return sr.Bottleneck != nil && sr.Date != nil && sr.DepthReference != nil | |
304 } | 305 } |
305 | 306 |
306 func (sr *SoundingResult) loadMeta(f *zip.File) (*models.SoundingResultMeta, error) { | 307 func (sr *SoundingResult) loadMeta(f *zip.File) (*models.SoundingResultMeta, error) { |
307 if f == nil { | 308 if f == nil { |
309 var epsg uint | |
310 if sr.EPSG != nil { | |
311 epsg = *sr.EPSG | |
312 } else { | |
313 epsg = models.WGS84 | |
314 } | |
308 return &models.SoundingResultMeta{ | 315 return &models.SoundingResultMeta{ |
309 Date: *sr.Date, | 316 Date: *sr.Date, |
310 Bottleneck: *sr.Bottleneck, | 317 Bottleneck: *sr.Bottleneck, |
311 EPSG: *sr.EPSG, | 318 EPSG: epsg, |
312 DepthReference: *sr.DepthReference, | 319 DepthReference: *sr.DepthReference, |
313 }, nil | 320 }, nil |
314 } | 321 } |
315 r, err := f.Open() | 322 r, err := f.Open() |
316 if err != nil { | 323 if err != nil { |