Mercurial > gemma
comparison cmd/octree2contour/main.go @ 921:52cb0b82b490
Simplify contour lines on storage
Simplifying with a tolerance of 0.1 m can significantly reduce
storage requirements and improve performance of a WMS on top of the
results without visible losses for high resolution data.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 04 Oct 2018 18:53:22 +0200 |
parents | 39b5cf9a6b8f |
children | 0a0013fbda4a |
comparison
equal
deleted
inserted
replaced
920:862cc5ba4d1d | 921:52cb0b82b490 |
---|---|
11 "gemma.intevation.de/gemma/pkg/octree" | 11 "gemma.intevation.de/gemma/pkg/octree" |
12 ) | 12 ) |
13 | 13 |
14 var ( | 14 var ( |
15 one = flag.Bool("o", false, "create only a single contour") | 15 one = flag.Bool("o", false, "create only a single contour") |
16 step = flag.Float64("s", 0.5, "step with") | 16 step = flag.Float64("s", 0.5, "step width") |
17 tol = flag.Float64("t", 0.1, "tolerance for simplification") | |
17 max = flag.Float64("m", 10, "max height from lowest point") | 18 max = flag.Float64("m", 10, "max height from lowest point") |
18 bottleneck = flag.String("bottleneck", "", "bottleneck id") | 19 bottleneck = flag.String("bottleneck", "", "bottleneck id") |
19 date = flag.String("date", "", "date info") | 20 date = flag.String("date", "", "date info") |
20 ) | 21 ) |
21 | 22 |
109 log.Printf("loading took: %v\n", time.Since(start)) | 110 log.Printf("loading took: %v\n", time.Since(start)) |
110 start = time.Now() | 111 start = time.Now() |
111 all := process(tree) | 112 all := process(tree) |
112 log.Printf("processing took: %v\n", time.Since(start)) | 113 log.Printf("processing took: %v\n", time.Since(start)) |
113 start = time.Now() | 114 start = time.Now() |
114 if err = store(all, tree.EPSG, *bottleneck, dateInfo); err != nil { | 115 if err = store(all, tree.EPSG, *bottleneck, dateInfo, *tol); err != nil { |
115 log.Printf("error: %v\n", err) | 116 log.Printf("error: %v\n", err) |
116 } | 117 } |
117 log.Printf("storing took: %v\n", time.Since(start)) | 118 log.Printf("storing took: %v\n", time.Since(start)) |
118 } | 119 } |
119 } | 120 } |