From 6bdc6c84dd9e6a207435d5e68a0842a4812581cd Mon Sep 17 00:00:00 2001 From: Oliver Tonnhofer Date: Mon, 7 Nov 2016 11:29:17 +0100 Subject: [PATCH] use named fields when initializing tagMatcher --- mapping/matcher.go | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/mapping/matcher.go b/mapping/matcher.go index 2dcd4da..8aa7b02 100644 --- a/mapping/matcher.go +++ b/mapping/matcher.go @@ -9,35 +9,60 @@ func (m *Mapping) PointMatcher() NodeMatcher { mappings := make(TagTables) m.mappings(PointTable, mappings) filters := m.ElementFilters() - return &tagMatcher{mappings, m.tables(PointTable), filters, false} + return &tagMatcher{ + mappings: mappings, + tables: m.tables(PointTable), + filters: filters, + matchAreas: false, + } } func (m *Mapping) LineStringMatcher() WayMatcher { mappings := make(TagTables) m.mappings(LineStringTable, mappings) filters := m.ElementFilters() - return &tagMatcher{mappings, m.tables(LineStringTable), filters, false} + return &tagMatcher{ + mappings: mappings, + tables: m.tables(LineStringTable), + filters: filters, + matchAreas: false, + } } func (m *Mapping) PolygonMatcher() RelWayMatcher { mappings := make(TagTables) m.mappings(PolygonTable, mappings) filters := m.ElementFilters() - return &tagMatcher{mappings, m.tables(PolygonTable), filters, true} + return &tagMatcher{ + mappings: mappings, + tables: m.tables(PolygonTable), + filters: filters, + matchAreas: true, + } } func (m *Mapping) RelationMatcher() RelationMatcher { mappings := make(TagTables) m.mappings(RelationTable, mappings) filters := m.ElementFilters() - return &tagMatcher{mappings, m.tables(RelationTable), filters, true} + return &tagMatcher{ + mappings: mappings, + tables: m.tables(RelationTable), + filters: filters, + matchAreas: true, + } } func (m *Mapping) RelationMemberMatcher() RelationMatcher { mappings := make(TagTables) m.mappings(RelationMemberTable, mappings) filters := m.ElementFilters() - return &tagMatcher{mappings, m.tables(RelationMemberTable), filters, true} + return &tagMatcher{ + mappings: mappings, + tables: m.tables(RelationMemberTable), + filters: filters, + matchAreas: true, + } } type Match struct {