📐 don't try to paint post-reduction-invalid polygons

This commit is contained in:
Michael Straßburger 2016-11-08 21:50:20 +01:00
parent f2cbeb465e
commit 74a4dffbe7
4 changed files with 13 additions and 9 deletions

View File

@ -50,7 +50,11 @@ module.exports = class Canvas
for ring in rings
if vertices.length
continue if ring.length < 3
holes.push vertices.length/2
else
return if ring.length < 3
for point in ring
vertices = vertices.concat point

View File

@ -292,12 +292,12 @@ module.exports = class Renderer
# else
# scaled = ([point.x, point.y] for point in simplify scaled, 2, false)
if filter
if scaled.length is 2
if @_seen[ka = (scaled[0]<<8)+scaled[1]] or
@_seen[kb = (scaled[1]<<8)+scaled[0]]
return []
@_seen[ka] = @_seen[kb] = true
# if filter
# if scaled.length is 2
# if @_seen[ka = (scaled[0]<<8)+scaled[1]] or
# @_seen[kb = (scaled[1]<<8)+scaled[0]]
# return []
#
# @_seen[ka] = @_seen[kb] = true
scaled

View File

@ -188,7 +188,7 @@ module.exports = class Termap
@zoom += @zoomy * @config.zoomStep
else
@zoomy *= -1
@_draw()
setImmediate => @_draw()
_getFooter: ->
# features = @renderer.featuresAt @mousePosition.x-1-(@view[0]>>1), @mousePosition.y-1-(@view[1]>>2)

View File

@ -72,7 +72,7 @@ class Tile
# TODO: monkey patching test case for tiles with a reduced extent 4096 / 8 -> 512
# use feature.loadGeometry() again as soon as we got a 512 extent tileset
geometries = feature.loadGeometry() #@_reduceGeometry feature, 8
geometries = feature.@_reduceGeometry feature, 8
if style.type is "fill"
nodes.push @_addBoundaries true,