Issues previewing and generating tiles with Tilestache

143 views
Skip to first unread message

Andrew

unread,
May 7, 2013, 2:35:09 AM5/7/13
to tiles...@googlegroups.com
Hey guys,

I have the Werkzeug server running for Tilestache but I'm having trouble requesting tiles and I'm not entirely sure why. The server is running correctly and "bellows hello" when I use localhost:8080. It's configured to use mbtiles that I have created earlier in TileMill. When I try and use the html preview it seems to keep reverting to the default 10/37.8000/-122.2600 which doesn't display anything as I only created tiles for zoom levels 15-18 and for a specific area. Changing the values to appropriate ones doesn't appear to have any effect and neither does adding a preview section to the tilestache.cfg:

"preview": {"lat": 32.2667, "lon": 150.9000, "zoom": 17, "ext": "png"}

If I instead try to request the specific tiles, with:

http://localhost:8080/roads/17/32/150.png

It returns that the image cannot be displayed because it contains errors. Checking the Tilestache cache indicates that images are being created however when I try to open them with another program, the picture cannot be displayed because the file is empty.

Would anyone be able to shed some light on why I'm having these issues? Thanks in advance for any help you guys can offer.

- Andrew

Michal Migurski

unread,
May 7, 2013, 12:43:55 PM5/7/13
to tiles...@googlegroups.com
Hi Andrew,

Do you see any errors from Werkzeug, in the terminal window where you're running it or error log if you're running it in the background?

Can you copy/paste your entire configuration here?

-mike.
> --
> You received this message because you are subscribed to the Google Groups "Tilestache" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to tilestache+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

----------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html




Andrew

unread,
May 8, 2013, 2:03:08 AM5/8/13
to tiles...@googlegroups.com
Hey Mike,

Thanks for getting back to me so quickly, here are those details you requested:

This is the Werkzeug output when I try the preview:

127.0.0.1 - - [08/May/2013 11:03:23] "GET /roads/preview.html HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/164/395.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/164/395.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/163/395.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/163/395.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/164/396.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/164/396.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/165/395.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/165/395.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/null HTTP/1.1" 400 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/null HTTP/1.1" 400 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/164/394.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/164/394.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/163/396.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/163/396.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/163/394.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/163/394.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/162/395.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/162/395.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/165/396.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/165/396.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/164/397.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/164/397.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/166/395.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/166/395.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/165/394.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/165/394.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/163/397.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/163/397.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/162/396.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/162/396.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/162/394.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/162/394.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/166/396.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/166/396.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/165/397.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/165/397.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/167/395.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/167/395.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/166/394.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:24] "GET /roads/10/166/394.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:25] "GET /roads/10/162/397.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:25] "GET /roads/10/162/397.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:25] "GET /roads/10/167/396.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:25] "GET /roads/10/167/396.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:25] "GET /roads/10/166/397.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:25] "GET /roads/10/166/397.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:25] "GET /roads/10/167/394.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:25] "GET /roads/10/167/394.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:25] "GET /roads/10/167/397.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:25] "GET /roads/10/167/397.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 11:03:25] "GET /favicon.ico HTTP/1.1" 400 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:25] "GET /favicon.ico HTTP/1.1" 400 -
127.0.0.1 - - [08/May/2013 11:03:25] "GET /favicon.ico HTTP/1.1" 400 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 11:03:25] "GET /favicon.ico HTTP/1.1" 400 -

And when I change the values in the preview:

127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/preview.html HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120477/53112.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120477/53112.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120476/53112.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120476/53112.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120477/53113.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120477/53113.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120476/53113.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120476/53113.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/null HTTP/1.1" 400 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/null HTTP/1.1" 400 -
127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120478/53112.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120478/53112.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120477/53111.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120477/53111.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120476/53111.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:15] "GET /roads/17/120476/53111.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120475/53112.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120475/53112.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/null HTTP/1.1" 400 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/null HTTP/1.1" 400 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120478/53113.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120478/53113.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120477/53114.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120477/53114.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120476/53114.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120476/53114.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120475/53113.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120475/53113.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/null HTTP/1.1" 400 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/null HTTP/1.1" 400 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120479/53112.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120479/53112.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120478/53111.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120478/53111.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120475/53111.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120475/53111.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120479/53113.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120479/53113.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/null HTTP/1.1" 400 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/null HTTP/1.1" 400 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120478/53114.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120478/53114.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120475/53114.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120475/53114.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120479/53111.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120479/53111.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120479/53114.png HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/17/120479/53114.png HTTP/1.1" 200 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/null HTTP/1.1" 400 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /roads/null HTTP/1.1" 400 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /favicon.ico HTTP/1.1" 400 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /favicon.ico HTTP/1.1" 400 -
127.0.0.1 - - [08/May/2013 15:59:16] "GET /favicon.ico HTTP/1.1" 400 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 15:59:16] "GET /favicon.ico HTTP/1.1" 400 -

This is the Werkzeug output when I try and request a specific tile:


127.0.0.1 - - [08/May/2013 16:00:50] "GET /roads/17/32.2667/150.9000.png HTTP/1.1" 400 -
INFO:werkzeug:127.0.0.1 - - [08/May/2013 16:00:50] "GET /roads/17/32.2667/150.9000.png HTTP/1.1" 400 -

Here is the configuration file:

{

  "cache":

    {

        "name": "Disk",

        "path": "/tmp/tilestachecache"

     },

  "layers":

     {

        "roads":

         {

            "provider":

            {      

                 "name": "mbtiles",

                     "tileset": "/home/******/tiles/australia.mbtiles",


                "preview": {"lat": 32.2667, "lon": 150.9000, "zoom": 17, "ext": "png"}

                }

          }

 

    }

}

Thanks for any help you can provide.

- Andrew

Michal Migurski

unread,
May 8, 2013, 7:22:06 PM5/8/13
to tiles...@googlegroups.com
Hi Andrew,

I'm guessing based on your URLs ("GET /roads/17/32.2667/150.9000.png") that you may need some help understanding the Z/X/Y tiling scheme. It looks to me like you're passing latitude and longitude values in your tile URLs, but that's not correct. They're actually supposed to be row and column values, and the range differs by zoom level.

There's not a lot at the lat/lon you gave in your examples:
http://teczno.com/squares/#17/32.266700/150.900000

The matching tile for that location, copied from the site above, is here:
http://tile.openstreetmap.org/17/120477/53112.png

A wordy explanation of the tiling scheme can be found here:
http://wiki.openstreetmap.org/wiki/QuadTiles

I hope I'm guessing right.

-mike.

Andrew

unread,
May 9, 2013, 2:45:27 AM5/9/13
to tiles...@googlegroups.com
Hey Mike,

You're right, I was trying to pass lat/long values so I've now been able to make it work. The reason there's nothing there is because I also didn't have a "minus" in front of the latitude value which was a bit of a dumb mistake but I can now request tiles for the area that I was actually trying to view.

Would you be able to advise me on how to go about requesting the necessary tiles using lat/long values? This is how the values are stored in the SQL database that I will be using so I'm unsure as to whether the values need to be converted or if there's another way that the tiles can be requested using lat/long.

Just one more quick question (sorry for all the bother) I was wondering if there's any functionality with IIS. We already have a Windows server configured to interact with the outside and I'm wondering if I would be able to use that to request and serve tiles from the Tilestache server or whether I would have to configure this as an additional web server. Thanks for any help and advice you can give me.

- Andrew

Michal Migurski

unread,
May 9, 2013, 1:23:39 PM5/9/13
to tiles...@googlegroups.com
On May 8, 2013, at 11:45 PM, Andrew wrote:

> Hey Mike,
>
> You're right, I was trying to pass lat/long values so I've now been able to make it work. The reason there's nothing there is because I also didn't have a "minus" in front of the latitude value which was a bit of a dumb mistake but I can now request tiles for the area that I was actually trying to view.
>
> Would you be able to advise me on how to go about requesting the necessary tiles using lat/long values? This is how the values are stored in the SQL database that I will be using so I'm unsure as to whether the values need to be converted or if there's another way that the tiles can be requested using lat/long.

Can you say more about how you plan to use this? What does the requesting/client end look like?


> Just one more quick question (sorry for all the bother) I was wondering if there's any functionality with IIS. We already have a Windows server configured to interact with the outside and I'm wondering if I would be able to use that to request and serve tiles from the Tilestache server or whether I would have to configure this as an additional web server. Thanks for any help and advice you can give me.

Oof, if you learn anything useful post it, but I have no IIS knowledge or access to a test environment!

-mike.

Andrew

unread,
May 14, 2013, 1:46:22 AM5/14/13
to tiles...@googlegroups.com
Hey Mike,

I'm generating reports in Crystal based on GPS data stored in an SQL database. I also want a hyperlink to be included in these Crystal reports that displays the information by overlaying GPS data over custom tiles that the Tilestache server will provide. I presume that something like Leaflet will be used to overlay the GPS data but I'm not entirely clear on how I will request the necessary tiles from the Tilestache server using the lat/long values that are stored in the SQL database.

So, on their end it will just be a hyperlink in a Crystal report that displays a slippy map with GPS data overlaid. On our end, a web page will be generated that contains tiles requested from the Tilestache server overlaid with GPS data requested from an SQL database (located on another server). So the SQL long/lat data will be used both to determine the tiles that are needed as well as the overlay for the tiles (ideally a polyline with popups containing additional data).

I will but I'm still unsure as to whether we will go down that route or not. It mainly comes down to which is the easier way of accomplishing the above. Using IIS is easier from an already-configured standpoint but it may not integrate so well with what I'm trying to do in which case I'll have to configure this server to communicate with the outside world.

Any help would be much appreciated.

-Andrew
Reply all
Reply to author
Forward
0 new messages