Giter Site home page Giter Site logo

xonacatl's Introduction

Xonacatl

Xonacatl is a "layers server", which takes requests for a subset of layers available and requests all the layers upstream, stripping out the unwanted layers when writing the response back to the client.

For example:

  1. The client requests a tile /buildings,water/0/0/0.json
  2. Xonacatl makes an upstream request for /all/0/0/0.json
  3. Xonacatl ignores anything in the GeoJSON response which isn't for buildings or water layers.
  4. The client reads back a tile containing only the layers they asked for.

Why?

Custom layers can be very helpful in reducing tile download size. Some layers, particularly buildings and landuse, can be large at certain zooms. Downloading this data unnecessarily can make apps feel less responsive.

On the other hand, creating tiles with custom layers is time-consuming and resource-intensive. It's much faster and cheaper to "cut out" the layers which the client wants from a tile containing all the layers. In fact, this is how tileserver works. Unfortunately, custom layers are customised, and the greater variety of their URLs means that cache hit ratios are reduced - on top of the additional latency of returning the request to the origin server.

Xonacatl is an attempt to do this at the "edge", closer to the client and taking advantage of as much "edge" caching as possible.

Why "xonacatl"?

Xonacatl is Nahuatl for onion, and tiles are like onions.

Installing

cd $GOPATH
go get -u github.com/golang/protobuf/proto
go get -u github.com/tilezen/xonacatl/xonacatl_server
go install github.com/tilezen/xonacatl/xonacatl_server

To update the generated protocol buffers code, you will need to run go generate and have the protobuf Go compiler plugin installed:

cd $GOPATH
go get -u github.com/golang/protobuf/protoc-gen-go
PATH=$PATH:$PWD/bin go generate github.com/tilezen/xonacatl

As is the Go convention, the generated source code is checked in. Unless you need to alter the original protocol buffers definiton, it shoud not be necessary to install the protoc-gen-go tool, or run go generate.

xonacatl's People

Contributors

zerebubuth avatar iandees avatar nvkelso avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.