The Following 8 Users Say Thank You to MartinK For This Useful Post: | ||
|
2012-03-15
, 13:58
|
Posts: 1,548 |
Thanked: 7,510 times |
Joined on Apr 2010
@ Czech Republic
|
#962
|
The countries are not a problem. But usually you don't want blank data right after the state border, that's the point.
I also have this idea of using a clustered setup. I also don't want my Twisted knowledge to rust. The company I'm working at announced an R&D lab for noncommercial, spinoff and hobby projects, so maybe someday I would talk them into building the most efficient OSM rendering farm in the world.
I don't know a thing about layers. All tiles are single layer, with all details already burnt-in. The point is that in OSM default stylesheet has better contrast overall, and maps rendered with it have proper city/village/whatever boundaries rendered, which my maps don't.
imposm, on the other hand, handles data much more efficiently on your average desktop/laptop hardware, my humble entry-level Thinkpad would crunch all of Europe in around 4 hours which is fast. The problem is, tables, tags and so on as produced by this tool, are totally different from what osm2pgsql provides.
So, in fact, I had to google "imposm osm.xml style compatible" and so on, getting irrelevant things at the top, until I've found OSM-bright and Carto. Then, the stylesheet produced makes what you see on the screenshot.
The OSM XML is so big that I don't have the faintest idea what to tweak so it would work.
Or maybe I would leave osm2pgsql running for a weekend with the latest Europe data, set up a cron job to incorporate differences as they flow in (osm2pgsql data allow this, imposm don't, AFAIK), and then render particular countries (so they have consistent data at the borders and so that anyone would be able to merge tilesets as he wishes).
rendering would become so complex that your phone would die of overheating / battery drain very fast.
Another way is to use OSM data (maybe in PBF format) to do the same, but I'm wondering how much study one has to invest into it, and how efficient would it be in the end. Wouldn't it be that in addition to quite big OSM datafiles there would need to be an even bigger index to efficiently search for needed data fragments?
Tiles are simple, on the other hand, and straightforward. You don't need to muck around with projections all the time, resorting instead to simple Cartesian arithmetic.
By some clever use of normalization and a few lines patch for ModRana I have been able to slim dataset for the whole of Poland with zoom level up to 15 and select cities up to 18, from 4792M to 4589M. That's the whole 203 megabytes less, with no performance
The Following User Says Thank You to MartinK For This Useful Post: | ||
|
2012-03-15
, 14:54
|
Posts: 242 |
Thanked: 97 times |
Joined on Sep 2009
|
#963
|
There are several thinks to try:If even all of the above does not help, start modrana with:
- check general Internet connectivity - are sites in Microb loading, etc.
- try another map layer, in Menu->Options->Map->Map Layers
- turn off map overlay in Menu->Options->Map->Map overlay
- if nothing of the above helps, try to delete/rename the file options.bin in /home/user/.modrana/
And post/pastbin the output you get.Code:modrana
|
2012-03-15
, 16:03
|
Posts: 1,548 |
Thanked: 7,510 times |
Joined on Apr 2010
@ Czech Republic
|
#964
|
Hi, thanks for the reply, I have set main map and background map both as "google maps" and the tile appearing problem is now resolved. I will like to download these as offline so I have been trying to use the download feature, and its not working. On that screen where it says "total size of tiles is unknown (click to compute)" I tap the screen to start the calc process, it does start but never tells me the size, its always 0MB. Then if I tap the "Start" button for download, it always says "downloads failed".
|
2012-03-20
, 11:30
|
Posts: 29 |
Thanked: 26 times |
Joined on Oct 2009
|
#965
|
The Following 3 Users Say Thank You to jafd For This Useful Post: | ||
|
2012-03-20
, 15:50
|
Posts: 29 |
Thanked: 26 times |
Joined on Oct 2009
|
#966
|
The Following 2 Users Say Thank You to jafd For This Useful Post: | ||
|
2012-03-22
, 12:28
|
Posts: 1,548 |
Thanked: 7,510 times |
Joined on Apr 2010
@ Czech Republic
|
#967
|
So, I managed to get speedup (not giving any numbers, I was too lazy to recheck) for generate_tiles.py which comes with mapnik.
After filling the data up, the normalization is done as follows: tile_id (integer) is added to lookup, and it references the ROWID of tiles table in the store. x, y, z and other columns beside ROWID and tile are dropped from the store. Also, I've seen no use for timestamp column, and dropped it altogether. As for store filename, I made it "store number" and use it to calculate the filename, like 'store.sqlite.'||store_number. All backward compatibility is achieved by using views.
So, on my todo list:
1) Make generate_tiles.py accept input files which tell what coordinates at what zoom levels should be generated;
2) Try even more space optimization tricks;
2.5) As a part of this, I suspect that some areas are still needlessly rendered and sliced, so investigate, it would save a few days' work;
3) Put the tile generator on github for all to see;
4) The generation process is very long and boring, so use urwid to visualise the progress in some way.
By the way, the most time-consuming task is PNG encoding. Unfortunately, we cannot encode first, then slice. However, we can employ some parallelizing tricks, as this task is very multiprocessing-friendly.
Some news from competition.
Installed MapDroyd on Android. They render vector data from some unbelievably efficient data files called MicroMap (http://www.onestepahead.de/index.php...omap&Itemid=62). Rendering is mindbogglingly fast. Maps take ridiculously little space. Borderlines look like sh*t at any zoom level: when far, they look like what you would draw on a whiteboard when asked to sketch a map of world. At close levels they look like what you would draw when asked to draw a map of world as precisely as you can with a pencil and no eraser.
Verdict: we still need ModRana on Android, like it or not.
The Following 3 Users Say Thank You to MartinK For This Useful Post: | ||
|
2012-03-22
, 18:03
|
Posts: 29 |
Thanked: 26 times |
Joined on Oct 2009
|
#968
|
The Following 2 Users Say Thank You to jafd For This Useful Post: | ||
|
2012-03-28
, 21:32
|
Posts: 1,548 |
Thanked: 7,510 times |
Joined on Apr 2010
@ Czech Republic
|
#969
|
The Following 8 Users Say Thank You to MartinK For This Useful Post: | ||
|
2012-03-29
, 14:32
|
Posts: 482 |
Thanked: 550 times |
Joined on Oct 2010
|
#970
|
The Following User Says Thank You to skykooler For This Useful Post: | ||
Tags |
bada rox, martin_rocks, modrana, navigation, openstreetmap, the best, wehasgps |
|
So I disabled it, fixed tile loading and started to work on all other broken & missing features (POI, online routing, turn-by-turn navigation, batch tile download, map overlay & rotation, tracklog support etc).
The source code of the renderer (pyrender) is actually still inside modRana BTW. I took a quick look at the code after about two years - and it actually doesn't look that bad. If I understand it correctly it takes an *.osm file (it can even download the OSM data for given tiles), loads it to memory using an XML parser and then renders a set of predefined tags as points or (poly)lines. There seems to be even some support for textual labels. It uses Cairo or PIL (Python Imaging Library) as the drawing backend.
Looks like that it might be a quite good base for a simple map renderer + there is a lot of room for various optimizations (pre-filtering OSM files, marshaling/caching parsed XML data, QPainter backend,...). Any interested developers ?
When I'm at it, I'll also take a closer look at the Kothic realtime python map renderer.
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)
Last edited by MartinK; 2012-03-15 at 13:30.