mirror of
https://github.com/omniscale/imposm3.git
synced 2025-02-23 07:54:02 +01:00
22 lines
439 B
Go
22 lines
439 B
Go
package mapping
|
|
|
|
import (
|
|
"testing"
|
|
|
|
osm "github.com/omniscale/go-osm"
|
|
)
|
|
|
|
func BenchmarkTagMatch(b *testing.B) {
|
|
m, err := FromFile("test_mapping.yml")
|
|
if err != nil {
|
|
b.Fatal(err)
|
|
}
|
|
matcher := m.PolygonMatcher
|
|
for i := 0; i < b.N; i++ {
|
|
e := osm.Relation{}
|
|
e.Tags = osm.Tags{"landuse": "forest", "name": "Forest", "source": "bling", "tourism": "zoo"}
|
|
if m := matcher.MatchRelation(&e); len(m) != 1 {
|
|
b.Fatal(m)
|
|
}
|
|
}
|
|
}
|