Winding order refers to the direction the vector tile draws a ring, either clockwise or counter-clockwise. It follows the commands of the "pen" to encode two rings. This is a step-by-step example showing how a single vector tile encodes geometry in the grid. They encode points, lines, and polygons as x/ y pairs relative to the top left of the grid in a right-down manner. Vector tiles hold no concept of geographic information. To encode geographic information into a vector tile a tool must convert geographic coordinates, such as latitude and longitude, into vector tile grid coordinates. Mapbox Vector Tiles and OpenStreetMap PBFs are protobuf files, but conform to completely different specifications and are used in different ways. PBFs are a format, much like XML and can take many forms. Mapbox Vector Tiles are not related at all to OpenStreetMap PBF files. The specification details are largely structured around the rules implemented in the base. For clarity, Mapbox Vector Tiles use the. Vector tiles are encoded as Google Protobufs (PBF), which allow for serializing structured data. This guide covers file format, examples of geometry encoding and attribute encoding, an explanation of the importance of winding order, and a list of concepts not included in the Mapbox vector tile specification.įor information about file formats and extensions, projections and bounds, and the internal structure of vector tiles, you can read the Mapbox Vector Tile Specification on GitHub.
Understanding these standards can help you understand how to work with Mapbox vector tiles.
Just as applications make assumptions about what information exists in a database, so do Mapbox tools make assumptions about how vector tiles store geographic information. This guide on vector tile standards explains how data is stored and encoded in vector tiles.