comparison pkg/imports/sr.go @ 5418:e89ff1894bb4 marking-single-beam

Don't clip the points against the border polygon. The implemented way was wrong.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 07 Jul 2021 18:27:40 +0200
parents 2d294ad81241
children 202715173935
comparison
equal deleted inserted replaced
5417:2d294ad81241 5418:e89ff1894bb4
700 return nil, err 700 return nil, err
701 } 701 }
702 } else { // SurveyTypeMarking 702 } else { // SurveyTypeMarking
703 if err := generateMarkingPoints( 703 if err := generateMarkingPoints(
704 ctx, tx, feedback, 704 ctx, tx, feedback,
705 xyz, removed, epsg, 705 xyz, epsg,
706 id, 706 id,
707 ); err != nil { 707 ); err != nil {
708 return nil, err 708 return nil, err
709 } 709 }
710 } 710 }
951 func generateMarkingPoints( 951 func generateMarkingPoints(
952 ctx context.Context, 952 ctx context.Context,
953 tx *sql.Tx, 953 tx *sql.Tx,
954 feedback Feedback, 954 feedback Feedback,
955 xyz mesh.MultiPointZ, 955 xyz mesh.MultiPointZ,
956 removed map[int32]struct{},
957 epsg uint32, 956 epsg uint32,
958 id int64, 957 id int64,
959 ) error { 958 ) error {
960 log.Printf("debug: generateMarkingPoints") 959 log.Printf("debug: generateMarkingPoints")
961 960
962 min, max := mesh.MinMaxVertex(xyz.FilterRemoved(removed)) 961 min, max := mesh.MinMaxVertex(xyz.All())
963 962
964 log.Printf("debug: min/max %.2f/%.2f\n", min.Z, max.Z) 963 log.Printf("debug: min/max %.2f/%.2f\n", min.Z, max.Z)
965 964
966 heights := loadClassBreaks(ctx, tx, feedback, min.Z, max.Z) 965 heights := loadClassBreaks(ctx, tx, feedback, min.Z, max.Z)
967 966
968 classes := heights.Classify(xyz.FilterRemoved(removed)) 967 classes := heights.Classify(xyz.All())
969
970 log.Printf("debug: removed %d\n", len(removed))
971 968
972 // Should not happen ... Z values over the top. 969 // Should not happen ... Z values over the top.
973 if n := len(classes) - 1; n > 1 && len(classes[n]) > 0 { 970 if n := len(classes) - 1; n > 1 && len(classes[n]) > 0 {
974 // Place the over the top values to the class below. 971 // Place the over the top values to the class below.
975 classes[n-1] = append(classes[n-1], classes[n]...) 972 classes[n-1] = append(classes[n-1], classes[n]...)