Mercurial > gemma
comparison pkg/imports/sr.go @ 5412:34bc6041e61e marking-single-beam
Added a type for class breaks.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 07 Jul 2021 10:58:14 +0200 |
parents | 9822a840d668 |
children | 4ad68ab239b7 |
comparison
equal
deleted
inserted
replaced
5411:9822a840d668 | 5412:34bc6041e61e |
---|---|
921 h := contourStepWidth * math.Ceil(minZ/contourStepWidth) | 921 h := contourStepWidth * math.Ceil(minZ/contourStepWidth) |
922 for ; h <= maxZ; h += contourStepWidth { | 922 for ; h <= maxZ; h += contourStepWidth { |
923 heights = append(heights, h) | 923 heights = append(heights, h) |
924 } | 924 } |
925 } else { | 925 } else { |
926 heights = mesh.ExtrapolateClassBreaks(heights, minZ, maxZ) | 926 heights = heights.ExtrapolateClassBreaks(minZ, maxZ) |
927 } | 927 } |
928 | 928 |
929 /* | 929 /* |
930 for i, v := range heights { | 930 for i, v := range heights { |
931 fmt.Printf("%d %.2f\n", i, v) | 931 fmt.Printf("%d %.2f\n", i, v) |
932 } | 932 } |
933 log.Printf("%.2f - %.2f\n", tree.Min.Z, tree.Max.Z) | 933 log.Printf("%.2f - %.2f\n", tree.Min.Z, tree.Max.Z) |
934 */ | 934 */ |
935 | 935 |
936 heights = common.DedupFloat64s(heights) | 936 heights = heights.Dedup() |
937 | 937 |
938 return generateIsoAreas(ctx, tx, feedback, tree, heights, id) | 938 return generateIsoAreas(ctx, tx, feedback, tree, heights, id) |
939 } | 939 } |
940 | 940 |
941 func generateIsoAreas( | 941 func generateIsoAreas( |
942 ctx context.Context, | 942 ctx context.Context, |
943 tx *sql.Tx, | 943 tx *sql.Tx, |
944 feedback Feedback, | 944 feedback Feedback, |
945 tree *mesh.STRTree, | 945 tree *mesh.STRTree, |
946 heights []float64, | 946 heights mesh.ClassBreaks, |
947 id int64, | 947 id int64, |
948 ) error { | 948 ) error { |
949 feedback.Info("Generate iso areas") | 949 feedback.Info("Generate iso areas") |
950 total := time.Now() | 950 total := time.Now() |
951 defer func() { | 951 defer func() { |
973 ctx context.Context, | 973 ctx context.Context, |
974 tx *sql.Tx, | 974 tx *sql.Tx, |
975 feedback Feedback, | 975 feedback Feedback, |
976 areas []wkb.MultiPolygonGeom, | 976 areas []wkb.MultiPolygonGeom, |
977 epsg uint32, | 977 epsg uint32, |
978 heights []float64, | 978 heights mesh.ClassBreaks, |
979 id int64, | 979 id int64, |
980 ) error { | 980 ) error { |
981 feedback.Info("Store iso areas.") | 981 feedback.Info("Store iso areas.") |
982 total := time.Now() | 982 total := time.Now() |
983 defer func() { | 983 defer func() { |