fix tag matching for elems with __any__ and exact matches
this allows you to have a table with mapping foo=__any__ and another one with foo=bar and an element with foo=bar will be inserted in both tablesmaster
parent
d41b108959
commit
07897d5402
|
@ -318,6 +318,12 @@ func TestPolygonMatcher(t *testing.T) {
|
|||
tags = element.Tags{"building": "residential"}
|
||||
matchesEqual(t, []Match{{"building", "residential", DestTable{"buildings", ""}, nil}}, polys.Match(&tags))
|
||||
|
||||
tags = element.Tags{"building": "shop"}
|
||||
matchesEqual(t, []Match{
|
||||
{"building", "shop", DestTable{"buildings", ""}, nil},
|
||||
{"building", "shop", DestTable{"amenity_areas", ""}, nil}},
|
||||
polys.Match(&tags))
|
||||
|
||||
tags = element.Tags{"landuse": "farm"}
|
||||
matchesEqual(t, []Match{{"landuse", "farm", DestTable{"landusages", ""}, nil}}, polys.Match(&tags))
|
||||
|
||||
|
|
|
@ -52,12 +52,11 @@ func (tagMatcher *TagMatcher) Match(tags *element.Tags) []Match {
|
|||
for _, t := range tbls {
|
||||
tables[t] = Match{k, v, t, tagMatcher.tables[t.Name]}
|
||||
}
|
||||
continue
|
||||
} else if tbls, ok := values[v]; ok {
|
||||
}
|
||||
if tbls, ok := values[v]; ok {
|
||||
for _, t := range tbls {
|
||||
tables[t] = Match{k, v, t, tagMatcher.tables[t.Name]}
|
||||
}
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue