only expire tiles when way/rel was inserted

master
Oliver Tonnhofer 2013-07-15 11:14:03 +02:00
parent 5f0d7ed3dd
commit f65b23a1c7
2 changed files with 13 additions and 6 deletions

View File

@ -66,9 +66,6 @@ NextRel:
continue NextRel
}
proj.NodesToMerc(m.Way.Nodes)
if rw.expireTiles != nil {
rw.expireTiles.ExpireFromNodes(m.Way.Nodes)
}
}
// BuildRelation updates r.Members but we need all of them
@ -117,6 +114,13 @@ NextRel:
}
}
}
if rw.expireTiles != nil {
for _, m := range allMembers {
if m.Way != nil {
rw.expireTiles.ExpireFromNodes(m.Way.Nodes)
}
}
}
}
geos.Destroy(r.Geom.Geom)
}

View File

@ -60,19 +60,22 @@ func (ww *WayWriter) loop() {
continue
}
proj.NodesToMerc(w.Nodes)
if ww.expireTiles != nil {
ww.expireTiles.ExpireFromNodes(w.Nodes)
}
inserted = false
if matches := ww.lineStringTagMatcher.Match(&w.Tags); len(matches) > 0 {
ww.buildAndInsert(geos, w, matches, geom.LineString)
inserted = true
}
if w.IsClosed() {
if matches := ww.polygonTagMatcher.Match(&w.Tags); len(matches) > 0 {
ww.buildAndInsert(geos, w, matches, geom.Polygon)
inserted = true
}
}
if inserted && ww.expireTiles != nil {
ww.expireTiles.ExpireFromNodes(w.Nodes)
}
if ww.diffCache != nil {
ww.diffCache.Coords.AddFromWay(w)
}