map2sqlite tool 1.0

531 views
Skip to first unread message

Frank Schröder

unread,
Jul 13, 2009, 9:21:18 AM7/13/09
to route-...@googlegroups.com
Hi route-me users,

I've uploaded the map2sqlite tool we've developed to create an sqlite
tile database which is compatible with the RMDBTileSource. It imports
all tiles found in a given directory tree into the tiles table and
creates the preferences from that. You can find it in the "Files"
section of the mailing list or at this link:

http://groups.google.com/group/route-me-map/web/map2sqlite-1.0.tar.bz2

The usage is very simple. Lets assume that you have a set of map tiles
from OpenStreetMap in the directory "mymap". The tiles are organized
by "<zoom>/<col>/<row>.png". In addition to the OSM tile structure the
code currently recognizes what I think is the ArcGis structure of
"L<zoom>/R<row>/C<col>.png" (row & col in hex, zoom in decimal).

You then run

map2sqlite -db mymap.db -mapdir mymap

to create an sqlite database file "mymap.db" with the contents from
the "mymap" directory.

After the import map2sqlite will print some statistics about the tiles
it has imported. Here is an example:

map2sqlite -db mymap.db -mapdir mymap
2009-07-13 14:16:58.514 map2sqlite[1213:10b] map2sqlite 1.0
2009-07-13 14:16:58.518 map2sqlite[1213:10b] Creating mymap.db
2009-07-13 14:16:58.524 map2sqlite[1213:10b] Importing map tiles at
mymap
2009-07-13 14:16:59.381 map2sqlite[1213:10b]
2009-07-13 14:16:59.382 map2sqlite[1213:10b] Map statistics
2009-07-13 14:16:59.382 map2sqlite[1213:10b] --------------
2009-07-13 14:16:59.383 map2sqlite[1213:10b] map db: mymap.db
2009-07-13 14:16:59.383 map2sqlite[1213:10b] file size:
3828736 bytes
2009-07-13 14:16:59.383 map2sqlite[1213:10b] tile directory: mymap
2009-07-13 14:16:59.384 map2sqlite[1213:10b] number of tiles: 234
2009-07-13 14:16:59.384 map2sqlite[1213:10b] zoom levels: 11 - 15
2009-07-13 14:16:59.385 map2sqlite[1213:10b] zoom level 11: 4
tiles, ( 710, 1089)x( 711, 1090),
{x=11.425781,y=48.224670}x{x=11.777344,y=47.989922}
2009-07-13 14:16:59.386 map2sqlite[1213:10b] zoom level 12: 9
tiles, ( 1420, 2178)x( 1422, 2180),
{x=11.425781,y=48.224670}x{x=11.689453,y=48.048710}
2009-07-13 14:16:59.386 map2sqlite[1213:10b] zoom level 13: 16
tiles, ( 2841, 4357)x( 2844, 4360),
{x=11.469727,y=48.195389}x{x=11.645508,y=48.078079}
2009-07-13 14:16:59.386 map2sqlite[1213:10b] zoom level 14: 49
tiles, ( 5682, 8715)x( 5688, 8721),
{x=11.491699,y=48.195389}x{x=11.645508,y=48.092758}
2009-07-13 14:16:59.387 map2sqlite[1213:10b] zoom level 15: 156
tiles, ( 11365, 17431)x( 11377, 17442),
{x=11.502686,y=48.188065}x{x=11.634521,y=48.092758}

To check the contents of the mymap.db file just run

$ sqlite3 mymap.db
SQLite version 3.4.0
Enter ".help" for instructions
sqlite> select count(*) from tiles;
234
sqlite> (poke some more at the database)

Enjoy :)

Frank

--
Frank Schröder
frank.s...@gmail.com

Reply all
Reply to author
Forward
0 new messages