remove tagmatcher from Writer
parent
748354ba18
commit
ce962c785e
|
@ -96,28 +96,24 @@ func Update(oscFile string, geometryLimiter *limit.Limiter, force bool) {
|
|||
wayTagFilter := tagmapping.WayTagFilter()
|
||||
nodeTagFilter := tagmapping.NodeTagFilter()
|
||||
|
||||
pointsTagMatcher := tagmapping.PointMatcher()
|
||||
lineStringsTagMatcher := tagmapping.LineStringMatcher()
|
||||
polygonsTagMatcher := tagmapping.PolygonMatcher()
|
||||
|
||||
relations := make(chan *element.Relation)
|
||||
ways := make(chan *element.Way)
|
||||
nodes := make(chan *element.Node)
|
||||
|
||||
relWriter := writer.NewRelationWriter(osmCache, diffCache, relations,
|
||||
db, polygonsTagMatcher, progress, config.BaseOptions.Srid)
|
||||
db, progress, config.BaseOptions.Srid)
|
||||
relWriter.SetLimiter(geometryLimiter)
|
||||
relWriter.SetExpireTiles(expiredTiles)
|
||||
relWriter.Start()
|
||||
|
||||
wayWriter := writer.NewWayWriter(osmCache, diffCache, ways, db,
|
||||
lineStringsTagMatcher, polygonsTagMatcher, progress, config.BaseOptions.Srid)
|
||||
progress, config.BaseOptions.Srid)
|
||||
wayWriter.SetLimiter(geometryLimiter)
|
||||
wayWriter.SetExpireTiles(expiredTiles)
|
||||
wayWriter.Start()
|
||||
|
||||
nodeWriter := writer.NewNodeWriter(osmCache, nodes, db,
|
||||
pointsTagMatcher, progress, config.BaseOptions.Srid)
|
||||
progress, config.BaseOptions.Srid)
|
||||
nodeWriter.SetLimiter(geometryLimiter)
|
||||
nodeWriter.Start()
|
||||
|
||||
|
|
|
@ -250,13 +250,10 @@ func mainimport() {
|
|||
diffCache.Ways.SetLinearImport(true)
|
||||
}
|
||||
osmCache.Coords.SetReadOnly(true)
|
||||
pointsTagMatcher := tagmapping.PointMatcher()
|
||||
lineStringsTagMatcher := tagmapping.LineStringMatcher()
|
||||
polygonsTagMatcher := tagmapping.PolygonMatcher()
|
||||
|
||||
relations := osmCache.Relations.Iter()
|
||||
relWriter := writer.NewRelationWriter(osmCache, diffCache, relations,
|
||||
db, polygonsTagMatcher, progress, config.BaseOptions.Srid)
|
||||
db, progress, config.BaseOptions.Srid)
|
||||
relWriter.SetLimiter(geometryLimiter)
|
||||
relWriter.Start()
|
||||
|
||||
|
@ -266,7 +263,7 @@ func mainimport() {
|
|||
|
||||
ways := osmCache.Ways.Iter()
|
||||
wayWriter := writer.NewWayWriter(osmCache, diffCache, ways, db,
|
||||
lineStringsTagMatcher, polygonsTagMatcher, progress, config.BaseOptions.Srid)
|
||||
progress, config.BaseOptions.Srid)
|
||||
wayWriter.SetLimiter(geometryLimiter)
|
||||
wayWriter.Start()
|
||||
|
||||
|
@ -276,7 +273,7 @@ func mainimport() {
|
|||
|
||||
nodes := osmCache.Nodes.Iter()
|
||||
nodeWriter := writer.NewNodeWriter(osmCache, nodes, db,
|
||||
pointsTagMatcher, progress, config.BaseOptions.Srid)
|
||||
progress, config.BaseOptions.Srid)
|
||||
nodeWriter.SetLimiter(geometryLimiter)
|
||||
nodeWriter.Start()
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"imposm3/element"
|
||||
"imposm3/geom"
|
||||
"imposm3/geom/geos"
|
||||
"imposm3/mapping"
|
||||
"imposm3/proj"
|
||||
"imposm3/stats"
|
||||
"log"
|
||||
|
@ -15,12 +14,11 @@ import (
|
|||
|
||||
type NodeWriter struct {
|
||||
OsmElemWriter
|
||||
nodes chan *element.Node
|
||||
tagMatcher *mapping.TagMatcher
|
||||
nodes chan *element.Node
|
||||
}
|
||||
|
||||
func NewNodeWriter(osmCache *cache.OSMCache, nodes chan *element.Node,
|
||||
inserter database.Inserter, tagMatcher *mapping.TagMatcher, progress *stats.Statistics,
|
||||
inserter database.Inserter, progress *stats.Statistics,
|
||||
srid int) *OsmElemWriter {
|
||||
nw := NodeWriter{
|
||||
OsmElemWriter: OsmElemWriter{
|
||||
|
@ -30,8 +28,7 @@ func NewNodeWriter(osmCache *cache.OSMCache, nodes chan *element.Node,
|
|||
inserter: inserter,
|
||||
srid: srid,
|
||||
},
|
||||
nodes: nodes,
|
||||
tagMatcher: tagMatcher,
|
||||
nodes: nodes,
|
||||
}
|
||||
nw.OsmElemWriter.writer = &nw
|
||||
return &nw.OsmElemWriter
|
||||
|
|
|
@ -7,7 +7,6 @@ import (
|
|||
"imposm3/element"
|
||||
"imposm3/geom"
|
||||
"imposm3/geom/geos"
|
||||
"imposm3/mapping"
|
||||
"imposm3/proj"
|
||||
"imposm3/stats"
|
||||
"log"
|
||||
|
@ -16,12 +15,11 @@ import (
|
|||
|
||||
type RelationWriter struct {
|
||||
OsmElemWriter
|
||||
rel chan *element.Relation
|
||||
tagMatcher *mapping.TagMatcher
|
||||
rel chan *element.Relation
|
||||
}
|
||||
|
||||
func NewRelationWriter(osmCache *cache.OSMCache, diffCache *cache.DiffCache, rel chan *element.Relation,
|
||||
inserter database.Inserter, tagMatcher *mapping.TagMatcher, progress *stats.Statistics,
|
||||
inserter database.Inserter, progress *stats.Statistics,
|
||||
srid int) *OsmElemWriter {
|
||||
rw := RelationWriter{
|
||||
OsmElemWriter: OsmElemWriter{
|
||||
|
@ -32,8 +30,7 @@ func NewRelationWriter(osmCache *cache.OSMCache, diffCache *cache.DiffCache, rel
|
|||
inserter: inserter,
|
||||
srid: srid,
|
||||
},
|
||||
rel: rel,
|
||||
tagMatcher: tagMatcher,
|
||||
rel: rel,
|
||||
}
|
||||
rw.OsmElemWriter.writer = &rw
|
||||
return &rw.OsmElemWriter
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"imposm3/element"
|
||||
"imposm3/geom"
|
||||
"imposm3/geom/geos"
|
||||
"imposm3/mapping"
|
||||
"imposm3/proj"
|
||||
"imposm3/stats"
|
||||
"log"
|
||||
|
@ -15,14 +14,12 @@ import (
|
|||
|
||||
type WayWriter struct {
|
||||
OsmElemWriter
|
||||
ways chan *element.Way
|
||||
lineStringTagMatcher *mapping.TagMatcher
|
||||
polygonTagMatcher *mapping.TagMatcher
|
||||
ways chan *element.Way
|
||||
}
|
||||
|
||||
func NewWayWriter(osmCache *cache.OSMCache, diffCache *cache.DiffCache, ways chan *element.Way,
|
||||
inserter database.Inserter, lineStringTagMatcher *mapping.TagMatcher,
|
||||
polygonTagMatcher *mapping.TagMatcher, progress *stats.Statistics, srid int) *OsmElemWriter {
|
||||
inserter database.Inserter,
|
||||
progress *stats.Statistics, srid int) *OsmElemWriter {
|
||||
ww := WayWriter{
|
||||
OsmElemWriter: OsmElemWriter{
|
||||
osmCache: osmCache,
|
||||
|
@ -32,9 +29,7 @@ func NewWayWriter(osmCache *cache.OSMCache, diffCache *cache.DiffCache, ways cha
|
|||
inserter: inserter,
|
||||
srid: srid,
|
||||
},
|
||||
ways: ways,
|
||||
lineStringTagMatcher: lineStringTagMatcher,
|
||||
polygonTagMatcher: polygonTagMatcher,
|
||||
ways: ways,
|
||||
}
|
||||
ww.OsmElemWriter.writer = &ww
|
||||
return &ww.OsmElemWriter
|
||||
|
|
Loading…
Reference in New Issue