mapbox / vt-pbf

Serialize Mapbox Vector Tiles to binary protobufs in javascript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does it encoding Polygon/MultiPoint correctly?

wsw0108 opened this issue · comments

It seems that:

  • No command ClosePath appeared in code
  • No command MoveTo with count great than 1

Thanks @wsw0108 -- looking at the spec, it appears the ClosePath command is indeed required:

Each ExteriorRing and InteriorRing MUST consist of the following sequence:

A MoveTo command with a command count of 1
A LineTo command with a command count greater than 1
A ClosePath command

@springmeyer @flippmoke do you have any context on why this hasn't caused us problems before now? Maybe we were just lucky?

@anandthakker

  1. Although there was no ClosePath command, the concept of LinearRing which part of Polygon make it just work.
  2. MultiPoint is not supported, I will make a pr for this.