Skip to content

Loading…

Route-Me yields: Warning: I could not find the column named 'tile_data' on TileFill mbtiles #145

Closed
justdan0227 opened this Issue · 6 comments

3 participants

@justdan0227

I have a problem regarding the implementation of a exported mbtiles file with route-me. I used the example on github and was able to compile and view the example map (control-room).

Now I tried to use an TileMill exported mbtiles file that i created (NewOrleans.mbtiles) and imported into XCode with the example and it did not work.

I get this error message: Warning: I could not find the column named 'tile_data'.

Version of TileMill: Version 0.5.1 (2917)
Version of Mac: Lion
Version of Xcode: 4.0.2

$sqlite3 -header -column control-room-0.2.0.mbtiles
SQLite version 3.7.6.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
metadata tiles
sqlite> .schema tiles
CREATE TABLE tiles (zoom_level integer, tile_column integer, tile_row integer, tile_data blob);
CREATE UNIQUE INDEX tile_index on tiles (zoom_level, tile_column, tile_row);
sqlite> .quit

$sqlite3 -header -column NewOrleans.mbtiles
SQLite version 3.7.6.3
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
grid_data grid_utfgrid images map tiles
grid_key grids keymap metadata
sqlite> .schema tiles
CREATE VIEW tiles AS
SELECT
map.zoom_level AS zoom_level,
map.tile_column AS tile_column,
map.tile_row AS tile_row,
images.tile_data AS tile_data
FROM map
JOIN images ON images.tile_id = map.tile_id;
sqlite>

@incanus

It could be that you are at a zoom level or bounds that is not supported in your tile set? The MBTiles backend uses FMDB for SQLite support, and by default, that logs errors doing lookups, meaning it can't find a particular tile z/x/y combo as a row.

@justdan0227

Hmmmm I'll revisit that. The starting Lat/Long are the same Lat/Long that are in the settings of the TileMill project as well as the zoom level.

@incanus

I would try breaking on -tileImage: and see what the tile.zoom/x/y are and look at those manually in the SQLite to confirm.

@justdan0227

Thanks. I need to look up what "pow" does as the following code does not allow me to view Y. It tells me that it's an optimized variable which I've never seen what that means. Zoom and x are ok, however I can't view or even 'po y' in the debugger.

  • (RMTileImage *)tileImage:(RMTile)tile
    {
    NSAssert4(((tile.zoom >= self.minZoom) && (tile.zoom <= self.maxZoom)),
    @"%@ tried to retrieve tile with zoomLevel %d, outside source's defined range %f to %f",
    self, tile.zoom, self.minZoom, self.maxZoom);

    NSInteger zoom = tile.zoom;
    NSInteger x = tile.x;
    NSInteger y = pow(2, zoom) - tile.y - 1;

@justdan0227

Well found it. I went back to the settings page and copied the lat/long to 6 decimal places and it worked!. I guess the rounding that I had for lat/long and the small window I had placed it outside the bounds of the view. I'm going to look at some better messages to be displayed in the debugger when that condition occurs. Thanks incanus!

@onato

This log message would not appear if we would check to see if a result was returned before trying to get a column on it.

// RMMBTilesSource.m
…
116.     //  [results next];
117.     if ([results next]) {
118.         NSData *data = [results dataForColumn:@"tile_data"];
119.         
120.         if ( ! data)
121.             image = [RMTileImage errorTile];
122.         else
123.             image = [UIImage imageWithData:data];
124.     }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.