View Single Post
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#1829
Thanks for the reply

Originally Posted by MartinK View Post
but I'm not sure if I'll be able to build it for Sailfish OS and I have serious doubts of an Android build being doable.
Well, Sailfish is Linux, so grabbing the packaged mapnik and its build-deps for Fedora or whatever should just work. As for Android, it's become such a caricature of what Linux should be that I don't have any idea. But if the Digia folks were able to run Qt there and Python runs there as well, why shouldn't boost & mapnik fail? But I guess xda-developers may be a better place to discuss mapnik on Android

Originally Posted by MartinK View Post
Still, the main issues still stands: How to get the data for rendering ? AFAIK big Mapnik tileservers use a Postgis database to fetch geometry during rendering - that would be probably too much of an overkill for the N900 and mobile devices in general. So some other more simple/lightweight format/store is needed that can still be plumbed to Mapnik (and/or ideally other potential renderers). Raw OSM data files (XML, PBF) won't do for any non-trivial area due to missing support for efficient random access and area queries.

Therefore some sort of custom format with pre-processed data will be needed - my current favorite is reusing the already present support for sqlite tile database files, but storing tile geometry instead of tile images, with optional per tile compression. Using this method the tile rendering backend would very easily query the geometry for any given tile.
There also options for just generating "geometry tiles" for all layers we might want to render for maximal simplicity and ultra fast fetching (this would make the database bigger than the raw OSM data for the area) or storing just a single (or a couple) of map layers and combine/split them for the given zoom level (meaning the database would not be (much) bigger than the raw OSM data for the area.

In short - I'm still investigating how to best do it and piecemail working on the needed components - testing your Mapnik port, investigating the QtQuick 2 Canvas, improving the modRana data repository, planning improvement in the tile storage module for "geometry tiles" support, etc.

Also as for related development - Basil Semuonov (probably best know for running Open Repos) has apparently been working on a offline rendering and routing server (I might have written about it already a while ago). That would also help a lot - provided that:
  1. he actually ever releases it (he seems to be generally really busy)
  2. it can be ported to Maemo (you have used your magic to port Magic, so I'm sure this would be easy for you ;-) )

More or less instant offline maps as his solution seems to have some sort of internal database (solving the data issue), can import raw OSM data and provides a localhost tile server (very easy to use by current modRana codebase).
Well, it must be easily convertible from the data here: http://download.geofabrik.de/europe/poland.html#

I have no clue about the custom format, but wouldn't it be a good idea to:
1. Create any offline vector maps, even if it'd be a killer
2. Then add code delaying the loading of the whole file into the memory (not a killer anymore but maybe a little slower - slow but reliable in case of no Internet connection)
3. Investigate the custom format, indexing or anything else to enable quick lookup.

Or maybe the pbf (for instance) file could be split into smaller chucks, e.g. 50 MB each depending on the coordinates? And than it would be trivial to get the proper file - take the coordinates x,y - let x1=f(x), y1=g(y) - take the file `map-$x1-$y1` - find the fragment. This would greatly diminish the amount of file reading and RAM used.

Well, I'd rather start considering the basil's once it's working. But I guess it shouldn't be very difficult to port.
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 

The Following 4 Users Say Thank You to marmistrz For This Useful Post: