paulmach / orb

Types and utilities for working with 2d geometry in Golang
MIT License
910 stars 103 forks source link

Support for Mapbox vector tiles specification 2.0/2.1 #11

Open dsahu75 opened 6 years ago

dsahu75 commented 6 years ago

Hi,

Any plans to support the latest version of Mapbox vector tiles specification in Orb

paulmach commented 6 years ago

From what I understand there is no data format difference between v1 and v2. The difference is v2 requires geometries be simple/clean. e.g. lines that are not self intersecting and polygons that are encoded in the correct winding order.

This library does not do anything to validate the geometry, it just encodes what you give it, so it defaults to v1. I've seen comments from mapbox about this and they only want you to claim your library is a v2 encoder if it does cleanup/validation.

However, If you know your geometry is simple/clean you can change the layer version manually.

Doing validation/cleanup is a complicated geometry problem that is bigger than MVT. I don't have plans to tackle.