View Single Post
Posts: 1,548 | Thanked: 7,510 times | Joined on Apr 2010 @ Czech Republic
#947
Originally Posted by jafd View Post
Like a bird flying up and down, in other words?
Yep, like that.

Originally Posted by jafd View Post
No no no, I want Mapnik on a PC on the same LAN as N900. The thing is, I want a cache of a whole country - it's HUGE, N900 would just die from choking while processing it.
Yeah, I got that. But the only-one I know with some Mapnik experience is Woody.

Originally Posted by jafd View Post
Another way would be a batch rendering with Mapnik (and not mucking around with mod_tile and friends) and mass import into SQLite, but the link to a Perl script posted a few pages ago is dead.
Well, that quite sucks - I should have mirrored the script... Well, I'll PM the author, maybe he can re-upload it.

Originally Posted by jafd View Post
Like, here's what would be downloaded in "Around here" mode (where is "here"? GPS location or visible window center?), here's what would be downloaded in "Around view" mode (portion outside screen? Visible window's center?), here's what would get downloaded around route.
Yes, unfortunately modRana documentation is currently quite lacking... Would you be perhaps willing to write a short guide/manaul ?

Concerning the labels:
around here = download is centered around current GPS coordinates (renaming this to "around current location or "around coordinates" might make this less confusing)
around view = download is centered around a point in the middle of the currently visible map (probably should be also renamed to "around map center")

Originally Posted by jafd View Post
From the experiences I've had with SQLite, it's better to have just a single writer thread, and queue up things you want to insert/update there.
This is roughly how it should work right now - there is a worker thread that processes tiles from a queue. Tile download threads - from automatic tile download or from batch download - supply tiles to this queue. Once the queue fills up (it can hold 50 tiles at once by default) all tiles are flushed to the database in a single transaction by the worker thread. At shutdown, the worker is notified and flushes any remaining tiles from the queue to the database.

Tile loading works in a similar manner - there is a tile loading worker thread that processes tile loading requests from a queue and loads tiles from database to a in-memory cache, guarded by a mutex. Not sure if the tile loading thread is really needed on on newer Python versions though.

Originally Posted by jafd View Post
I have tried to do that myself, but got lost in the code - seems like "download" and "store" parts are not quite separate.
Yeah, it might be a bit convoluted. It's structure basically like this:
mod_mapTiles - draws the map and automatically downloads visible tiles
mod_mapData - handles batch tile download
mod_storeTiles - handles tile storage, both to files and to sqlite, contains both worker threads mentioned above and all database handling logic

BTW, there is a description of the tile database structure on modRana project wiki.
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader
Universal Components - a solution for native looking yet component set independent QML appliactions (QtQuick Controls 2 & Silica supported as backends)
 

The Following User Says Thank You to MartinK For This Useful Post: