Skip to content

Commit

Permalink
Compact suggests to prevent duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
gerdos82 committed Jan 16, 2025
1 parent dcd6ff8 commit 15e15cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/etl/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ collections:
displayNameTemplate: "{{ .component_thoroughfarename }} - {{ .component_addressareaname | firstupper }}"
etl:
suggestTemplates:
- "{{ .component_thoroughfarename }} {{ .component_addressareaname }}"
- "{{ .component_thoroughfarename }} {{ .component_addressareaname }}"
- "{{ .component_thoroughfarename }}, {{ .component_postaldescriptor }} {{ .component_addressareaname }}"
ogcCollections:
Expand Down
3 changes: 3 additions & 0 deletions internal/etl/transform/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"errors"
"fmt"
"slices"
"strconv"
"strings"
"text/template"
Expand Down Expand Up @@ -64,6 +65,8 @@ func (t Transformer) Transform(records []RawRecord, collection config.GeoSpatial
suggestions = append(suggestions, suggestion)
}
}
suggestions = slices.Compact(suggestions)

bbox, err := r.transformBbox()
if err != nil {
return nil, err
Expand Down

0 comments on commit 15e15cf

Please sign in to comment.