TileStache.Goodies.Providers.UtfGridComposite | index

`Composite Provider for UTFGrid layers
https://github.com/mapbox/utfgrid-spec/blob/master/1.2/utfgrid.md
Combines multiple UTFGrid layers to create a single result.
The given layers will be added to the result in the order they are given.
Therefore the last one will have the highest priority.
Sample configuration:
"provider":
{
"class": "TileStache.Goodies.Providers.UtfGridComposite:Provider",
"kwargs":
{
"stack":
[
{ "layer_id": "layer1", "src": "my_utf_layer1", "wrapper": "grid" },
{ "layer_id": "layer2", "src": "my_utf_layer2", "wrapper": "grid" }
],
"layer_id": "l",
"wrapper": "grid"
}
}
stack: list of layers (and properties) to composite together
layer_id: an id attribute that will be added to each json data object for this layer: { "layer_id": "layer1", "name": "blah", "address": "something"}
src: layer name of the layer to composite
wrapper: the wrapper definition of this layer if there is one (so we can remove it)
layer_id: the key for the layer_id attribute that is added to each data object: { "l": "layer1", ...}
wrapper: wrapper to add to the resulting utfgrid "WRAPPER({...})". Usually "grid"
if layer_id is not set in the layer or the provider config then it will not be set on data objects`

Modules

``

TileStache | json |  |

Classes

``

Provider
SaveableResponse

class Provider

``

Methods defined here:

__init__(self, layer, stack, layer_id=None, wrapper=None)

addLayer(self, layerDef, coord)

decodeId(self, id)

encodeId(self, id)

getTypeByExtension(self, extension)
  `Get mime-type and format by file extension.
  This only accepts "json".`

renderTile(self, width, height, srs, coord)

writeResult(self)

class SaveableResponse
`` | `Wrapper class for JSON response that makes it behave like a PIL.Image object. TileStache.getTile() expects to be able to save one of these to a buffer.`

Methods defined here:

__init__(self, content)

save(self, out, format)