imposm3/mapping/matcher_test.go

23 lines
454 B
Go
Raw Normal View History

package mapping
2013-12-16 19:54:42 +04:00
import (
"testing"
2015-01-05 11:52:13 +03:00
"github.com/omniscale/imposm3/element"
2013-12-16 19:54:42 +04:00
)
func BenchmarkTagMatch(b *testing.B) {
2015-11-20 17:03:08 +03:00
m, err := NewMapping("test_mapping.yml")
if err != nil {
b.Fatal(err)
}
matcher := m.PolygonMatcher
for i := 0; i < b.N; i++ {
e := element.Relation{}
e.Tags = element.Tags{"landuse": "forest", "name": "Forest", "source": "bling", "tourism": "zoo"}
if m := matcher.MatchRelation(&e); len(m) != 1 {
b.Fatal(m)
}
}
}