Giter Site home page Giter Site logo

tuilx's Introduction

TuilX

An extensible and composable WMTS server.

TuilX allows you to easily setup a WMTS server by creating and/or combining tile sources.

TuilX provides some basic sources like:

Source Description
Geopackage Reads WMTS tiles from geopackage files
Mapbox Retrieves WMTS tiles from MapBox
ESAMaps Retrieves WMTS tiles from the European Space Agency services

There are also utility sources (aka middleware) like:

Source Description
Cacher Adds a cache to a source
Masker Applies masking to tiles
Resizer Resizes tiles
Fallback Retrieves a tile from a fallback source if the primary source fails
Tracer Trace (opencensus) the retrieval of a tile from a source
Switcher Switches among sources depending on conditions

The list of sources is potentially infinite, you can develop your own: any struct satisfying the following interface is a tile source:

type Source interface {
	GetTile(ctx context.Context, props tile.Properties) (*tile.Tile, error)
	Name() string
}

To setup your server you just need to provide a source:

// Create the web server
server := server.New(mySource)

where mySource is any of the basic sources or a combination of them. For example:

primary := source.NewESAMaps("s2cloudless-2018", esa-auth-token)
fb := source.NewMapBox("satellite-v9", mb-auth-token)
mySource := middleware.NewFallback(primary, fb)

will try to serve the requested tile from the Sentinel-2 ESA layer, and if retrieval fails, it will serve the tile from MapBox satellite layer.

If then you are interested in tracing the tile retrieval:

primary := source.NewESAMaps("s2cloudless-2018", esa-auth-token)
fb := source.NewMapBox("satellite-v9", mb-auth-token)
mySource := middleware.Trace(middleware.NewFallback(primary, fb))

Then you may decide to add a cache to MapBox source:

primary := source.NewESAMaps("s2cloudless-2018", esa-auth-token)
fb := middleware.NewCacher(myRedis, source.NewMapBox("satellite-v9", mb-auth-token))
mySource := middleware.Trace(middleware.NewFallback(primary, fb))

Take a look at cmd/tuilx-svr.go for a complete example.

tuilx's People

Contributors

chavacava avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.