openmaptiles/postserve

Possibly incorrect winding order

MattBlissett opened this issue · 2 comments

According to node-mapnik, "Vector Tile has POLYGON with first ring clockwise. It is not valid according to v2 of VT spec."

A very simple tile, decoded with the protobuf decoder:

layers {
  name: "landcover"
  features {
    tags: 0
    tags: 0
    tags: 1
    tags: 0
    type: POLYGON
    geometry: 9
    geometry: 7534
    geometry: 6334
    geometry: 26
    geometry: 406
    geometry: 42
    geometry: 42
    geometry: 201
    geometry: 429
    geometry: 43
    geometry: 15
  }
  keys: "class"
  keys: "subclass"
  values {
    string_value: "farmland"
  }
  extent: 4096
  version: 2
}

The vertices are:

3767,3167
3970,3188
3991,3087
3776,3065
3767,3167

I'm not sure I'm reading the spec correctly, but in any case it's the opposite winding order from the Feature-single-polygon.mvt tile from mvt-fixtures.

(A workaround is to change the version to 1, which doesn't have the counterclockwise requirement. They then render correctly: )

Great to know Matt!

Please note that postserve has been merged into tools - https://github.com/openmaptiles/openmaptiles-tools#test-tiles and this repo should be closed. Thanks!