Tilestache as JSON proxy?

121 views
Skip to first unread message

Thomas Hirsch

unread,
Dec 30, 2011, 6:31:40 AM12/30/11
to Tilestache
Hi all -

I would like to use Tilestache{ as a pure proxy for json/bson
requests. Is this possible with the current configuration, or where
would you suggest I make that change in the code?
Currently, when I try the configuration

"provider":
{
"name": "proxy",
"url": "http://localhost/layer/{B}" //my json provider - not
sure if the bbox substitution works, but that's not the issue yet
}

or

"provider":
{
"name": "url template",
"template": "http://localhost/layer/$ymin,$xmin,$ymax,$xmax"
}

and request
http://localhost:8080/roads/1/2/3.json

I get an error

Known unknown!
Unknown extension in configuration: "json"

If I request
http://localhost:8080/roads/1/2/3.png
it tries to render something and breaks, too.

Thanks in advance,
Thomas

Michal Migurski

unread,
Dec 30, 2011, 1:13:54 PM12/30/11
to tiles...@googlegroups.com
Hi Thomas,

The bbox sub probably won't work, and the Proxy provider restricts responses to images. But, there's no reason TileStache couldn't be used this way if you wrote the appropriate provider class. Ian Dees's UrlTemplate provider should provide some guidance:
https://github.com/migurski/TileStache/blob/master/TileStache/Providers.py#L270

It's possible that you'd only need to expand the range of mime-types on offer by defining a getTypeByExtension() method:
http://tilestache.org/doc/#custom-providers

Hope this is helpful!

-mike.

----------------------------------------------------------------
michal migurski- mi...@stamen.com
415.558.1610

Reply all
Reply to author
Forward
0 new messages