Skip to content

Simplification algo appears to cause tile seam artifacts. #183

Open
@remster

Description

@remster

We had to turn the simplification off as wedges would develop on tile seams preventing the bleed/buffer (grep for buffer) to be correctly applied. My guess is that Douglas–Peucker that you use removes poly edges that we have deliberately bleed out of the tile for proper blending. At least this is my theory.

I am not a tiling expert, but why wouldn't it be appropriate here:

	for _, p := range points {
		dx, dy := c.GetDeltaPointAndUpdate(p)
		//	encode our delta point
		g = append(g, encodeZigZag(dx), encodeZigZag(dy))
	}
	return g

to check whether there dx,dy are different from previous and skip them if they're the same. Wouldn't that serve as oftentimes sufficient simplification?

Here's the offending geometry:

{
  "coordinates": [
    [
      [
        -118.915929794311523,
        34.13671875
      ],
      [
        -118.915929794311523,
        34.08899026424313
      ],
      [
        -118.944625096552102,
        34.08899026424313
      ],
      [
        -118.949598455211159,
        34.090160115815209
      ],
      [
        -118.964824913325486,
        34.096622314681383
      ],
      [
        -118.978246085407733,
        34.105430017405581
      ],
      [
        -118.989346656919466,
        34.11624539420265
      ],
      [
        -118.997699850573255,
        34.128653494887246
      ],
      [
        -119.000850912295292,
        34.13671875
      ],
      [
        -119.002983854653664,
        34.142178092208631
      ],
      [
        -119.003992080688477,
        34.149260049035767
      ],
      [
        -119.003992080688477,
        34.161889212837202
      ],
      [
        -118.915929794311523,
        34.161889212837202
      ],
      [
        -118.915929794311523,
        34.13671875
      ]
    ]
  ],
  "type": "Polygon"
}

with simplification on:
withsimplification

without simplification:
wosimplification

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions