Empty preview map

221 views
Skip to first unread message

Chris

unread,
Apr 2, 2012, 7:12:47 PM4/2/12
to Tilestache
I have made a test mbtile cache in tilemill, using some of the mapbox
data. I fired up tilestache-server.py in Python 2.7 (windows). I get a
blank browser screen, the source shows this:

<!DOCTYPE html>
<html>
<head>
<title>TileStache Preview: test</title>
<script src="http://code.modestmaps.com/tilestache/
modestmaps.min.js" type="text/javascript"></script>
<meta name="viewport" content="width=device-width, initial-
scale=1.0, maximum-scale=1.0, user-scalable=0;" />
</head>
<body style="position: absolute; width: 100%; height: 100%;">
<script type="text/javascript">
<!--

var template = '{Z}/{X}/{Y}.png';
var provider = new
com.modestmaps.TemplatedMapProvider(template);
var map = new MM.Map(document.body, provider);
map.setCenterZoom(new com.modestmaps.Location(41.000000,
-80.000000), 5);
// hashify it
new MM.Hash(map);

//-->
</script>
</body>
</html>


The config file is:


{
"cache":
{
"name": "Memcache",
"servers": ["127.0.0.1:8080"],
"revision": 0
},
"layers":
{
"test":
{
"provider":
{
"name": "mbtiles",
"tileset": "test.mbtiles"
},
"preview":
{
"lat": 41,
"lon": -80,
"zoom": 5,
"ext": "png"
}
}
}
}

And the stdout shows:

127.0.0.1 - - [02/Apr/2012 19:11:03] code 400, message Bad request
syntax ('add
0/test/5/6/12.PNG-lock 0 15 7')
127.0.0.1 - - [02/Apr/2012 19:11:03] "add 0/test/5/6/12.PNG-lock 0 15
7" 400 -
127.0.0.1 - - [02/Apr/2012 19:11:03] code 400, message Bad HTTP/0.9
request type
('get')
127.0.0.1 - - [02/Apr/2012 19:11:03] "get 0/test/5/6/12.PNG" 400 -
127.0.0.1 - - [02/Apr/2012 19:11:03] code 400, message Bad HTTP/0.9
request type
('delete')
127.0.0.1 - - [02/Apr/2012 19:11:03] "delete 0/test/5/6/12.PNG-lock"
400 -
127.0.0.1 - - [02/Apr/2012 19:11:03] code 400, message Bad HTTP/0.9
request type
('get')
127.0.0.1 - - [02/Apr/2012 19:11:03] "get 0/test/5/8/14.PNG" 400 -
127.0.0.1 - - [02/Apr/2012 19:11:27] "GET /test/5/11/11.png HTTP/1.1"
500 -
Error on request:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\werkzeug-0.8.3-py2.7.egg\werkzeug
\serving.
py", line 159, in run_wsgi
execute(app)
File "C:\Python27\lib\site-packages\werkzeug-0.8.3-py2.7.egg\werkzeug
\serving.
py", line 146, in execute
application_iter = app(environ, start_response)
File "C:\Python27\lib\site-packages\tilestache-1.29.3-py2.7.egg
\TileStache\__i
nit__.py", line 373, in __call__
mimetype, content = requestHandler(self.config,
environ['PATH_INFO'], enviro
n['QUERY_STRING'])
File "C:\Python27\lib\site-packages\tilestache-1.29.3-py2.7.egg
\TileStache\__i
nit__.py", line 271, in requestHandler
mimetype, content = getTile(layer, coord, extension)
File "C:\Python27\lib\site-packages\tilestache-1.29.3-py2.7.egg
\TileStache\__i
nit__.py", line 96, in getTile
tile = layer.render(coord, format)
File "C:\Python27\lib\site-packages\tilestache-1.29.3-py2.7.egg
\TileStache\Cor
e.py", line 363, in render
tile = provider.renderTile(width, height, srs, coord)
File "C:\Python27\lib\site-packages\tilestache-1.29.3-py2.7.egg
\TileStache\MBT
iles.py", line 216, in renderTile
mime_type, content = get_tile(self.tileset, coord)
File "C:\Python27\lib\site-packages\tilestache-1.29.3-py2.7.egg
\TileStache\MBT
iles.py", line 162, in get_tile
format = db.execute("SELECT value FROM metadata WHERE
name='format'").fetcho
ne()
OperationalError: no such table: metadata
127.0.0.1 - - [02/Apr/2012 19:11:27] code 400, message Bad request
syntax ('add
0/test/5/8/14.PNG-lock 0 15 7')
127.0.0.1 - - [02/Apr/2012 19:11:27] "add 0/test/5/8/14.PNG-lock 0 15
7" 400 -
127.0.0.1 - - [02/Apr/2012 19:11:27] code 400, message Bad HTTP/0.9
request type
('get')
127.0.0.1 - - [02/Apr/2012 19:11:27] "get 0/test/5/8/14.PNG" 400 -
127.0.0.1 - - [02/Apr/2012 19:11:27] code 400, message Bad HTTP/0.9
request type
('delete')
127.0.0.1 - - [02/Apr/2012 19:11:27] "delete 0/test/5/8/14.PNG-lock"
400 -
127.0.0.1 - - [02/Apr/2012 19:11:27] code 400, message Bad HTTP/0.9
request type
('get')
127.0.0.1 - - [02/Apr/2012 19:11:27] "get 0/test/5/7/13.PNG" 400 -

Chris

unread,
Apr 4, 2012, 11:55:14 AM4/4/12
to Tilestache
Can anyone supply an example .mbtiles and .cfg to try?

Arek Skalski

unread,
Apr 4, 2012, 2:25:06 PM4/4/12
to tiles...@googlegroups.com
It looks like you are missing a table inside database:

format = db.execute("SELECT value FROM metadata WHERE name='format'").fetchone()
 OperationalError: no such table: metadata

Is there an input file for mbtiles in which you should contain above table??

2012/4/4 Chris <csom...@gmail.com>

Chris

unread,
Apr 4, 2012, 4:14:55 PM4/4/12
to Tilestache
This seems to be part of my problem.There is a metadata table in that
sqlite DB. Could it be that tilestache is having trouble reading any
data from the db, and thats why I get a blank screen? Do I need a
different path in my .cfg?

On Apr 4, 2:25 pm, Arek Skalski <askalsk...@gmail.com> wrote:
> It looks like you are missing a table inside database:
>
> format = db.execute("SELECT value FROM metadata
> WHERE name='format'").fetchone()
>  OperationalError: no such table: metadata
>
> Is there an input file for mbtiles in which you should contain above table??
>
> 2012/4/4 Chris <csomer...@gmail.com>

Chris

unread,
Apr 6, 2012, 7:24:29 PM4/6/12
to Tilestache
Turns out the relative path in the .cfg was the problem, and it was
creating empty sqlite db's at the root of my drive. When I gave it a
full path it works fine.
Reply all
Reply to author
Forward
0 new messages