Skip to content

box-id/vector_tile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VectorTile

Hex.pm Version Hexdocs Static Badge

Implementation of the Vector Tile Spec, version 2.1. This package allows you to efficiently build vector tiles including layers and features with geometry and encode them to protobuf.

Usage

The following sample shows how to create a simple vector tile with one layer and one point feature:

alias VectorTile.{
  Feature,
  Layer,
  Tile
}

# Create an empty named layer
layer = %Layer{
  name: "clusters",
  version: 2
}

# Add a feature with attributes
layer = Layer.add_feature(
  layer,
  Feature.point([128, 128]),
  count: 42,
  size: "large"
)

# Construct tile
tile = %Tile{
  layers: [layer]
}

# Encode to protobuf bytes
Tile.encode(tile)

Installation

def deps do
  [
    {:vector_tile, "~> 1.1.0"}
  ]
end

About

Elixir implementation of the Vector Tile Specification: https://github.com/mapbox/vector-tile-spec

Resources

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages