maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] modRana: a flexible GPS navigation system (https://talk.maemo.org/showthread.php?t=58861)

白い熊 2011-12-04 19:10

Re: directions_filter.csv
 
Quote:

Originally Posted by MartinK (Post 1133149)
Can you check if the position is updated if you restart modRana ?

Yes, it is.
Quote:

Also, try to enable "Show gpsd debug output" in Options->Debug->GPS, modRana will start printing the information it gets from gpsd to stdout.
I ran gpsd with debugging, and when it reads data from a regular socket file, created by socat, it's updated fine...

Quote:

This certainly also possible - modRana already has a worker thread (in the location module that resides in modules/mod_location.py that reads position data from GPSD. The worker thread could be modified to connect to BlueNMEAs socket and parsing the NMEA sentences it provides. There is just a single stable source (BlueNMEA) without the usual quirks of standard GPS devices, the parsing should not be that difficult, at least for basic location data (latitude, longitude, elevation, speed, direction(?)).
This might speed things up for the chroot... However it thus seems the fault is with VNC, if it sends uncompressed frames, then no wonder it can't keep up while moving as it's updated continually.

I never messed with VNC, never really used it. Will try to look into it...

Anyhow, I currently see two possibilities for improvement when using VNC:

Currently, I use 24-bit color profile, to make modRana useable with the VNC viewer, otherwise the colors got distorted. Other possible viewer profiles are: 256, 64, and 8 colors, or greyscale, and black-and-white. So would it be possible to limit modRana's colors to 8 or max 64 on startup programatically? This would decrease the amount of data sent drastically?

Second, have an option in modrana to update the display only let's say every second, so that this would also decrease the data sent significantly?

This might make modRana useable under VNC?

白い熊 2011-12-05 02:19

Re: modRana on Android
 
The more I think about it, the more I think it's the continuous display updates, more than anything.

Martin, would it be possible to have an option allowing you to select how often to redraw the main window, i.e. continuous, and then once in how many seconds...?

MartinK 2011-12-19 16:41

Re: modRana on Android
 
Quote:

Originally Posted by 白い熊 (Post 1132969)
OK, I ran more experiments.
However, it seems that there is heavy processing going on, either on the modRana side, the GTK side, or, probably, the gpsd side, as I'd have the GPS point in modRana disappear for let's say 10 seconds at a time, then the position would update, the circle appear, then disappear again.

When it'd disappear, modRana would not react to screen taps, leading me to believe that there is some heavy processor load going on.

In fact a couple of times, modrana's window would go completely gray without displaying anything, and I had to kill modRana.

In Options->Debug->Redrawing you can enable Print redraw time to terminal. With this you can debug both how often the screen actually redraws and how long each redraw takes.

Quote:

Originally Posted by 白い熊 (Post 1132969)
This seemed to disapper after I disabled automatic rotation in the direction of the car movement, leading me to believe the processing load is too heavy for VNC access to X on Android.

Yep, rotation in its current unaccelerated form is unfortunately quite resource-expensive. Also modRana always redraws the complete viewport (with the exception of the simple manual map dragging method) which probably further slows down the VNC viewer that might be trying to only transfer areas that have changed, which won't work as the whole screen changes.

Also by default, when a new tile is loaded, the screen is redrawn - this might be an issue when moving too fast, eq. many new tiles are loaded all the time. this behavior can be disabled in Options->Debug->Tiles->Redraw screen once a new tile is loaded. Might help to reduce the number of redraws quite a bit.

There is also another trick used to reduce the are that needs to be redrawn:
Just update the area around the position indicator and redraw the whole screen only once it gets too close to the edge (TangoGPS works like this). This is not yet implemented in modRana.

Quote:

Originally Posted by 白い熊 (Post 1132969)
what I'm hoping for, it's the gpsd interaction somehow...

Yes, this is still a possibility - the location info reading thread wakes up every time GPSD has a position update. If it is feeding too many updates, the thread might be running too often, hogging resources.
You can debug this by enabling Show GPSD debug output in
Options->Debug->GPS and checking how often the a new fix is reported.

Quote:

Originally Posted by 白い熊 (Post 1132969)
If not, then messing with TightVNC remains the option, lowering the number of colors of TightVNC display, this is an option, as it can interface at 256 colors, there would probably have to be some filter in modRana to only use 256 colors when started in a specific way, that could lead to processing speed increase...

The whole GUI is drawn with Cairo - would have to check out if it can do this (probably can). Still might end up to be more resource intensive than no filter. :)

Quote:

Originally Posted by 白い熊 (Post 1132969)
However, cutting out gpsd might still be worth it, though the main hog is probably X VNC access...

Yes, but I'd rather first make sure this is what's really causing it as using GPSD simplifies quite a few things. :) Would bet its rather the frequent fullscreen redraws swamping the VNC viewer.


Quote:

Originally Posted by 白い熊 (Post 1132969)
Second, have an option in modrana to update the display only let's say every second, so that this would also decrease the data sent significantly?

Quote:

Originally Posted by 白い熊 (Post 1133284)
The more I think about it, the more I think it's the continuous display updates, more than anything.

Martin, would it be possible to have an option allowing you to select how often to redraw the main window, i.e. continuous, and then once in how many seconds...?

If Options->Debug->Tiles->Redraw screen once a new tile is loaded is disabled, the screen should actually update just about once a second. But it might be a good idea to add an option that forces a fixed global redraw interval.

白い熊 2011-12-20 13:43

Re: modRana on Android
 
OK, something fishy is definitely going on...

I did uncheck the 'redraw once new tile is loaded' option, and then: it seems modrana still gets stuck, in a funny way... The cursor position, and the blue box with directions would disappear for 10-20 seconds at a time, while the underlying map, with the traced route is visible... Anyhow the cursor and blue box would flicker on for a split second, only during this time, if you'd touch the screen, I could access the menu.

It is apparent that gpsd is not the hog though, since once I'd get in the menu, I could flip through options and nothing would get stuck, though gpsd is clearly still running in the background.

Once out in the map though, it'd get stuck again.

Tried to display the tile load times in terminal, that's when I noticed some python cairo errors coming up in the terminal.

Anyhow, couldn't capture these, as my drive just ended. Said something about impossible rotation though or something.

I'll capture the full errors in the morning and post.

Could it be, that there's some python/cairo mess-up going on and due to this the display is getting stuck?

MartinK 2012-01-12 23:43

Re: modRana on Android
 
Quote:

Originally Posted by 白い熊 (Post 1139951)
OK, something fishy is definitely going on...

I did uncheck the 'redraw once new tile is loaded' option, and then: it seems modrana still gets stuck, in a funny way... The cursor position, and the blue box with directions would disappear for 10-20 seconds at a time, while the underlying map, with the traced route is visible... Anyhow the cursor and blue box would flicker on for a split second, only during this time, if you'd touch the screen, I could access the menu.

This behavior might be a sign of some errors halfway in the drawing process. ModRana first draws the base map layer, than map overlay and then a screen overlay. If some layers are missing, there might have been some errors while it was drawn. Can you check the stdout output ? Also, modRana can log to file, just enable it in options->Debug->Logging->Log modRana stdout to file to make modRana log to a file in .modrana folder in your home directory.

Quote:

Originally Posted by 白い熊 (Post 1139951)
It is apparent that gpsd is not the hog though, since once I'd get in the menu, I could flip through options and nothing would get stuck, though gpsd is clearly still running in the background.

Once out in the map though, it'd get stuck again.

Tried to display the tile load times in terminal, that's when I noticed some python cairo errors coming up in the terminal.

Interesting !
Quote:

Originally Posted by 白い熊 (Post 1139951)
Anyhow, couldn't capture these, as my drive just ended. Said something about impossible rotation though or something.

I'll capture the full errors in the morning and post.

Could it be, that there's some python/cairo mess-up going on and due to this the display is getting stuck?

That might very well be the case - but I have to see what errors are reported & when do they show up. Cairo in your chroot might be missing some features or might have some bugs. Still, it might be possible to find an (android) chroot specific workaround as it seems to work fine at other times.

Joseph9560 2012-01-13 02:03

Re: [Announce] modRana: a flexible GPS navigation system
 
If I start downloading map and stop it in the middle of downloading, then download the map of the same (or say locations that will overlap with whatever map I have already downloaded) then will it download all the maps again or will it share the previous data with the new download?

I was trying to download 80Km map with all possible zoom levels, I don't seem to be able to download whole map at once (left it overnight once, result was restarted device in the morning). Maybe I will use pc for downloading maps now.

woody14619 2012-01-13 02:19

Re: [Announce] modRana: a flexible GPS navigation system
 
Some providers limit how many map tiles you can download in a set time-frame, and start blocking/banning you if you do too many too fast. Try choosing another map provider.

As to the question: Yes, if you download 10% of the tiles, they're still there. When you re-start, it will skip downloading those tiles as it hits them. At least that was true the last time I used it, to grab tiles. I cached 90% of the area I usually am in, and rarely get tile traffic because of that now.

Joseph9560 2012-01-13 02:27

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by woody14619 (Post 1149815)
Some providers limit how many map tiles you can download in a set time-frame, and start blocking/banning you if you do too many too fast. Try choosing another map provider.

As to the question: Yes, if you download 10% of the tiles, they're still there. When you re-start, it will skip downloading those tiles as it hits them. At least that was true the last time I used it, to grab tiles. I cached 90% of the area I usually am in, and rarely get tile traffic because of that now.

At first I tried google map without any success (not a single tile was downloaded), later downloaded openstreet map (or whatever it is called). My calculation was I would have to download about 200Mbs based on what I already had downloaded but I haven't reached beyond about 10Mbs of downloads. 12Mbps wifi but downloads are very slow, maybe lots of computation or maybe openstreet limits the download speed a lot.

MartinK 2012-01-13 10:15

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by woody14619 (Post 1149815)
As to the question: Yes, if you download 10% of the tiles, they're still there. When you re-start, it will skip downloading those tiles as it hits them. At least that was true the last time I used it, to grab tiles. I cached 90% of the area I usually am in, and rarely get tile traffic because of that now.

Yep, modRana skips downloading of tiles it already has. :)

Quote:

Originally Posted by Joseph9560 (Post 1149820)
12Mbps wifi but downloads are very slow, maybe lots of computation or maybe openstreet limits the download speed a lot.

Some on the high zoomlevel tiles (zl 15+) might not be actually stored on the server but the server generates them on-demand, as storing them all would consume a huge amount of storage. This might be (much) slower than just sending pre-generated tiles it has in storage.

MartinK 2012-01-15 19:54

Re: [Announce] modRana: a flexible GPS navigation system
 
Request for comments - modRana roadmap
While designing the new Qt/QML based GUI for modRana I wrote a roadmap.

The roadmap currently contains mostly GUI related stuff but status of other items (offline routing/map rendering, voice output localization, offline POI catalogs, etc.) should show up eventually. I will update the status of the items as the work progresses.

So, what you you think ?
Have a better design proposal ? Is there something missing or not clear enough ? Don't hesitate and tell me! Or even just edit the wiki article itself(but please add your nick to your edits so I don't miss them & can react).

Also, modRana now has its own Maemo wiki page.

MartinK 2012-01-22 20:01

Re: [Announce] modRana: a flexible GPS navigation system
 
A short progress update:
I'm finished with adding modular GUI support and the current GTK interface now runs from its own GUI module. I have also transplanted a Qt GUI module from Mieru but it still needs some work to actually do anything. :) I added support for proper CLI arguments handling - currently only for specifying the which GUI and device modules to load.
Theroadmap has been updated to show what items are done.

droll 2012-01-22 23:01

Re: [Announce] modRana: a flexible GPS navigation system
 
thank you for the hard work!!

ejasmudar 2012-01-23 05:29

Re: [Announce] modRana: a flexible GPS navigation system
 
Man, I am so looking forward to the harmattan version. Nokia maps suck POI wise here in India and cloudGPS is too gimmickky and buggy

白い熊 2012-01-30 06:55

Re: modRana on Android
 
Quote:

Originally Posted by 白い熊 (Post 1139951)
The cursor position, and the blue box with directions would disappear for 10-20 seconds at a time, while the underlying map, with the traced route is visible... Anyhow the cursor and blue box would flicker on for a split second, only during this time, if you'd touch the screen, I could access the menu.

Tried to display the tile load times in terminal, that's when I noticed some python cairo errors coming up in the terminal.

I'll capture the full errors in the morning and post.

Hmm, it seems "in the morning" translates to in a "month and a half"... :O(

Anyhow, I did capture it finally, and it definitely seems to be pango/cairo based, though no idea what it's about. Am posting the full log of a short run just in case, though the error seems to be one and the same...

Edit: had to cut out some of the error log, as the resultant text is too long to post...
Code:

~ $ modrana
Xlib:  extension "RANDR" missing on display ":1.0".
 == modRana Starting ==
 device string (first parameter): android_chroot
size allocate gtk.gdk.Rectangle(0, 0, 480, 640)
error in screen invalidating function
exception: 'NoneType' object has no attribute 'invalidate_rect'
importing modules:
 * messages: Handles messages (10.00 ms)
 * markers: A module handling markers on the map. (10.00 ms)
 * icons: Draw icons (0.00 ms)
 * updateTiles: Update stored map tiles. (0.00 ms)
 * cron: A timing and sheduling module for modRana. (20.00 ms)
 * route: Routes (30.00 ms)
 * mapData: Handle downloading of map data (130.00 ms)
 * display: A platform independent display device control module (0.00 ms)
 * positionMarker: A sample pyroute module (0.00 ms)
 * example: A sample pyroute module (0.00 ms)
 * showPOI: Show POI on the map and in the menu. (0.00 ms)
 * notification: This module provides notification support. (0.00 ms)
 * showGPX: draws a GPX track on the map (10.00 ms)
 * projection: Projection code (lat/long to screen conversions) (0.00 ms)
 * tracklogManager: Module for managing tracklogs (0.00 ms)
 * clickHandler: handle mouse clicks (0.00 ms)
 * askMenu: A sample pyroute module (0.00 ms)
 * log: A modRana logging module (0.00 ms)
 * mapTiles: Display map images (60.00 ms)
 * sketch: Sketching functionality (0.00 ms)
 * stats: Handles messages (0.00 ms)
 * mapView: Controls the view being displayed on the map (0.00 ms)
 * search: Search for POI (0.00 ms)
 * showOSD: Draw OSD (On Screen Display). (70.00 ms)
 * animatedMapView: A sample pyroute module (0.00 ms)
 * keys: A keyboard input handling module (10.00 ms)
 * textEntry: A module for hadnling text entry. (0.00 ms)
 * units: A module handling unit conversions and dispplaying correct units acording
to current settings. (0.00 ms)
 * info: A modRana information handling module (10.00 ms)
 * voice: Handle text to speach. (0.00 ms)
 * onlineServices: Module for communication with various online services. (20.00 ms)
 * tracklog: Record tracklogs (0.00 ms)
 * menu: Handle menus (10.00 ms)
 * routeProfile: Creates a route profile (an elevation chart) (0.00 ms)
 * interfaceFeedback: A sample pyroute module (0.00 ms)
 * loadTracklogs: A sample pyroute module (0.00 ms)
 * options: Handle options (0.00 ms)
 * storePOI: Store POI data. (20.00 ms)
 * location: Supplies position info from GPSD (0.00 ms)
 * input: Handle input from keyboard, buttons, etc. (0.00 ms)
 * config: Handle configuration, options, and setup (0.00 ms)
 * storeTiles: Single-file-fs tile storage (20.00 ms)
 * turnByTurn: A turn by turn navigation module. (0.00 ms)
 * device: A Neo FreeRunner modRana device-specific module (0.00 ms)
Loaded all modules in 430.00 ms, initialising
icons: switched theme to: default
storePOI: connection to POI db in /home/shiroikuma/.modrana/poi/modrana_poi.db
estabilshed
location: enabling location
location: gpsd debugging output turned OFF
GPSDConsumer: starting
mapTiles: map folder path: /home/shiroikuma/.modrana/maps
**log: opening stdout log file
**log: redirectiong stdout to log file:\
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)

...

Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)
Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 148, in drawScreenOverlay
    self.drawButton(cr, x1, y1, dx, dy, '', minusIcon, "mapView:zoomOut")
  File "modules/mod_menu.py", line 309, in drawButton
    self.icons.draw(cr,icon,x1,y1,w,h)
  File "modules/mod_icons.py", line 346, in draw
    self.drawIcon(cr, self.images[cacheName], x, y, w, h)
  File "modules/mod_icons.py", line 466, in drawIcon
    cr.save()
cairo.Error: invalid matrix (not invertible)

shutdown imminent, commiting all uncommited tiles
storeTiles: sqlite committ OK

all tiles commited, breaking, goodbye :)

mapTiles: automatic tile download management thread shutting down
GPSDConsumer: breaking
GPSDConsumer: stopped
Shuttdown complete
~ $


Joseph9560 2012-01-30 08:22

Re: [Announce] modRana: a flexible GPS navigation system
 
Thanks a lot for such a wonderful navigation app. Its the best I havd tried in N900. And now you are moving to Qml, I would expect sexier UI! Can anyone tell me what this app doesn't (yet) do as compared to Sygic Mobile Maps except offline routing (which is very nice feature and modrana should be getting it soon). Thanks a lot for continuing the development of this great app, thanks from the heart.

MartinK 2012-02-05 17:09

Re: modRana on Android
 
Quote:

Originally Posted by 白い熊 (Post 1157693)
Code:

Traceback (most recent call last):
  File "modrana.py", line 1015, in do_expose_event
    return self._expose_cairo(event, cr)
  File "modrana.py", line 1011, in _expose_cairo
    self.draw(cr,event)
  File "modrana.py", line 676, in draw
    self.currentDrawMethod(cr,event)
  File "modrana.py", line 754, in fullDrawMethod
    m.drawScreenOverlay(cr)
  File "modules/mod_menu.py", line 104, in drawScreenOverlay
    self.drawText(cr, text, x1, y1, w/3, h, 0) # draw a reminder
  File "modules/mod_menu.py", line 272, in drawText
    pg = pangocairo.CairoContext(cr)
cairo.Error: invalid matrix (not invertible)


Hmm, this is not an Android specific issue - I remember getting the same (cairo.Error: invalid matrix (not invertible)) error during development. I thing it was while I was working on automatic map rotation and it somehow stopped showing up. Still, there might be something Android/chroot specific triggering it.

A few questions:
How does this look like on the screen (IMHO at leas some text and graphics should be missing)?
Does this happen with or without map rotation ?
Do you use map layer overlay ?
Also an unrelated question - can you check what Qt version is available in your Chroot and if QML and PySyide/PyQt are available ? So that I know if the new QML/Qt Components based GUI is also relevant for the Andoroid Chroot or just for native environments. BTW, thanks to THP, there is now both PySide and Qt available for Android so modRana with the new Qt GUI should be also able to run natively on Android in the near future. :)


Also a progress update:
The GUI logic is now completely separated from the main modRana class and there are now two functional GUI modules - GTK and QML. I spent the last few days making sure that both GUIs work as expected and that there are hopefully no regressions in the GTK GUI.

The QML GUI currently only shows a white window it finally starts & shuts down cleanly so I can start porting views from AGTL (map view, Augmented Reality view, compass) and writing my own (menu, listable menu, tracklog info, poi detail, search, routing, download manager, etc.).

Also, due to outdated Qt & PySide on non-CSSU Fremantle modRana might be CSSU-only, at least for the start. CSSU also basically has the same PySide, Qt, QML and Qt Components versions as Harmattan, making maintenance easier due to single code base.

白い熊 2012-02-06 09:18

Re: modRana on Android
 
Quote:

Originally Posted by MartinK (Post 1160906)
How does this look like on the screen (IMHO at leas some text and graphics should be missing)?

When stationary, everything is displayed. Once you start moving, the position cursor disappears, and everything freezes, the display doesn't move, you cannot access the menu. The errors start popping up when you start moving.
Quote:

Does this happen with or without map rotation ?
Both. With map rotation it's unuseable, i.e. it freezes almost completely, guess more errors...
Quote:

Do you use map layer overlay ?
No, I've turned it off.
Quote:

Also an unrelated question - can you check what Qt version is available in your Chroot and if QML and PySyide/PyQt are available ?
I use arme debian unstable, so libqt4 4.7.4-2, qt4-qmlviewer same version, python-pyside 1.1.0-1 and pyqt-tools 3.18.1-5
Quote:

BTW, thanks to THP, there is now both PySide and Qt available for Android so modRana with the new Qt GUI should be also able to run natively on Android in the near future. :)
This is good news, so perhaps even sound output from modrana, as it seems to me there's no way to produce sound from within the chroot...

Thalass 2012-02-23 06:23

Re: [Announce] modRana: a flexible GPS navigation system
 
Hey thanks for this great program. It's my primary GPS program nowdays.

One thing i've noticed lately: If you try and use open cycle maps, the tiles all fail to download - i get the 'due to network error' tiles instead. Have OCM changed their address or something? It shouldn't be my end as this is both on wifi and 3g, and all the other maps work. Has anyone had this problem?

Anyway, thanks! Can't wait to try out the AR mode in the new version. :)

Joseph9560 2012-03-08 06:57

Re: [Announce] modRana: a flexible GPS navigation system
 
I saved a POI with name name "Tuscany Suites & Casino". Funny part is neither the name of the POI is listed under the POI (or say an item with blank name is listed), nor the description is shown in the POI detail. I can see that its because of "&". Please fix it.

Also while saving a route as a tracklog it is not saving the correct date. Its currently 10:51 3/7/2012 (GMT-8) but the last modified date is something like 6:48:34 8.3.2012, surely some time zone calculation error as far as I can see.

Also searching for something like "Tuscany Suites Hotel & Casino, 255 E. Flamingo Road, Las Vegas, Nevada 89169 " doesn't seems to return proper address. Am I right to say that search of address is performed via Google irrespective of tile provider being used? Google earth provides proper result (or results with proper one) in pc.

Thanks!

MartinK 2012-03-11 19:19

Re: [Announce] modRana: a flexible GPS navigation system
 
Qt GUI progress update
This time with pictures. :)

http://modrana.org/images/qt_gui/qml_map_landscape.png
Map view in landscape
http://modrana.org/images/qt_gui/qml_map_portrait.png
Map view in portrait

The map view is mostly based on the PinchMap from AGTL, with some added buttons - for the menu and a fullscreen button (probably not needed on Harmattan).

http://modrana.org/images/qt_gui/qml..._landscape.png
Main menu in landscape

http://modrana.org/images/qt_gui/qml...u_portrait.png
Main menu in portrait - the menu is scrollable

http://modrana.org/images/qt_gui/qml_options.png
Options menu

http://modrana.org/images/qt_gui/qml...ns_pressed.png
Options menu, demonstrating button-press feedback

When a button is pressed, it sinks a bit and changes color to a lighter tone (all of this is smoothly animated) and the caption text becomes bold.

I choose to to use the icon-grid menu because it works quite nicely both portrait and in landscape. Still, I would like to trim the number of "levels" one has to go through to get something done.

Other GUI elements would be more "modern": lists with kinetic scrolling & search, full screen selection dialogs, proper text entry fields, sliders, etc. This is thanks to the huge array of modern GUI elements available in QML, in contrast to having to write everything from the ground up when using (the quite slow) combination of Cairo and GTK.

Concerning icons, a general face-lift and design unification might not be a bad idea - any theme artists out there ? ;)

PS.: I've seen your questions and will answer in a follow-on post. :)

白い熊 2012-03-11 19:31

Re: [Announce] modRana: a flexible GPS navigation system
 
Looking great man. How should I prepare to get ready for testing on Android?

MartinK 2012-03-11 19:40

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by 白い熊 (Post 1177989)
Looking great man. How should I prepare to get ready for testing on Android?

You can try to to install Qt & PySide by following THP's guide. :D Not sure about Qt Components availability though (you might need to compile them yourself :)).

MartinK 2012-03-11 20:47

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by Thalass (Post 1168582)
One thing i've noticed lately: If you try and use open cycle maps, the tiles all fail to download - i get the 'due to network error' tiles instead. Have OCM changed their address or something? It shouldn't be my end as this is both on wifi and 3g, and all the other maps work. Has anyone had this problem?

I know about this, you can try to use this workaround until it's fixed. I basically just need to update the map definition file & make sure the previous file is replaced by the new one (and rename & keep the old one as the user might have modified it in the meantime).

Quote:

Originally Posted by Joseph9560 (Post 1176341)
I saved a POI with name name "Tuscany Suites & Casino". Funny part is neither the name of the POI is listed under the POI (or say an item with blank name is listed), nor the description is shown in the POI detail. I can see that its because of "&".

Weird, I'll check it out.

Quote:

Originally Posted by Joseph9560 (Post 1176341)
Also while saving a route as a tracklog it is not saving the correct date. Its currently 10:51 3/7/2012 (GMT-8) but the last modified date is something like 6:48:34 8.3.2012, surely some time zone calculation error as far as I can see.

I'll check it out. :)

Quote:

Originally Posted by Joseph9560 (Post 1176341)
Also searching for something like "Tuscany Suites Hotel & Casino, 255 E. Flamingo Road, Las Vegas, Nevada 89169 " doesn't seems to return proper address. Am I right to say that search of address is performed via Google irrespective of tile provider being used? Google earth provides proper result (or results with proper one) in pc.

Yep, Google geocoder is currently used for address search. But I'd like to add other geocoders in the near future - Nominatim, Geonames, etc. Weird that it works with Google Earth - either it uses its own different private API or there are some encoding issues with the ampersand in the string ?

jafd 2012-03-12 10:08

Re: [Announce] modRana: a flexible GPS navigation system
 
I think I'm gonna need some help with this one.

I want to have a detailed map of a few cities pre-cached. I go to the city in question, then

1) Download -> around here -> 20 km
2) down max, up max (by the way, what do "down" and "up" mean? Does "down" mean zoom in, or zoom out?)
3) It works out 23k tiles
4) I zoom around the city and it tells me tiles must be downloaded. I don't know what area was actually downloaded.

I believe I'm wrong somewhere, but don't know where.

It would be of great help actually to have those settings illustrated. Say, here's a modrana window, scale is so and so, and the area to be covered is highlighted in blue for each mode.

By the way, sqlite interactions are prone to segfaults on amd64 python 2.7. It is for sure a regression on Python/SQLite side, but there needs to be a way to work it around.

Also, if anyone has set up a local tile server for modrana to use (say on a local network), could you please share how you did it? The openstreetmap wiki has the notorious open-source documentation problem, where old and outdated docs are intermixed with the current ones in an amusing enough way to leave one occupied for a week if not more.

MartinK 2012-03-12 11:07

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by jafd (Post 1178272)
I think I'm gonna need some help with this one.

I want to have a detailed map of a few cities pre-cached. I go to the city in question, then

1) Download -> around here -> 20 km
2) down max, up max (by the way, what do "down" and "up" mean? Does "down" mean zoom in, or zoom out?)

It means the number of zoom levels "up" and "down" from the current one. But good point, it might not be a bad idea to rename it to zoom in + zoom out.

Quote:

Originally Posted by jafd (Post 1178272)
3) It works out 23k tiles
4) I zoom around the city and it tells me tiles must be downloaded. I don't know what area was actually downloaded.

I believe I'm wrong somewhere, but don't know where.

What version of modRana do you have ?
Also, what tile layer are you trying to download ? Some tile providers (eq. Google) are unfortunatelly notoriously unfriendly to batch downloads. Also, were there some failed tiles during download or some error messages on stdout ? Please also check out if you have libmagic installed - modRana is using it to verify if the "tiles" it downloads are actually map images and not html error documents complaining about batch tile downloads returned by the tile provider.

Quote:

Originally Posted by jafd (Post 1178272)
It would be of great help actually to have those settings illustrated. Say, here's a modrana window, scale is so and so, and the area to be covered is highlighted in blue for each mode.

I would like to include a more interactive tile download mode in the new QML GUI. Something like dragging a rectangle aver an area, then selecting zoom level range with some sliders & starting the download.

Quote:

Originally Posted by jafd (Post 1178272)
By the way, sqlite interactions are prone to segfaults on amd64 python 2.7. It is for sure a regression on Python/SQLite side, but there needs to be a way to work it around.

Yeah I had quite a few issues already with sqlite with Python 2.5 that is present on the N900 (mostly related to broken threaded access to the database). Any idea what approximate sequence of events triggers the segfault ? I have a similar setup (Core i5 + Python 2.7) so I can try to reproduce that.

Quote:

Originally Posted by jafd (Post 1178272)
Also, if anyone has set up a local tile server for modrana to use (say on a local network), could you please share how you did it? The openstreetmap wiki has the notorious open-source documentation problem, where old and outdated docs are intermixed with the current ones in an amusing enough way to leave one occupied for a week if not more.

I think Woody14619 tried to get a tileserver running on the N900 a while ago, don't know how far he got though. Also, there is a realtime Python map renderer called Kothic that is somehow using Mapnik - they might have some info about setting it up.

jafd 2012-03-12 11:27

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

It means the number of zoom levels "up" and "down"
Like a bird flying up and down, in other words?
Quote:

What version of modRana do you have ?
0.29-2
Quote:

Also, what tile layer are you trying to download ?
openstreetmap; I also want to set up my own local mapnik to relieve some load on OSM servers.
Quote:

I think Woody14619 tried to get a tileserver running on the N900 a while ago, don't know how far he got though.
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.

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.

Quote:

Any idea what approximate sequence of events triggers the segfault ? I have a similar setup (Core i5 + Python 2.7) so I can try to reproduce that.
Just try to download a 40 km area for all zoom levels around Warsaw, Poland (it estimates to ~90k of tiles) and it eventually dies. Using Python 2.7.3rc1 on Ubuntu 12.04 beta. Curious thing, on N900 it doesn't die.
Quote:

I would like to include a more interactive tile download mode in the new QML GUI. Something like dragging a rectangle aver an area, then selecting zoom level range with some sliders & starting the download.
For now, a simple example would suffice. 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.
Quote:

Yeah I had quite a few issues already with sqlite with Python 2.5 that is present on the N900 (mostly related to broken threaded access to the database).
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. I have tried to do that myself, but got lost in the code - seems like "download" and "store" parts are not quite separate.

MartinK 2012-03-12 19:46

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by jafd (Post 1178306)
Like a bird flying up and down, in other words?

Yep, like that. :)

Quote:

Originally Posted by jafd (Post 1178306)
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. :)

Quote:

Originally Posted by jafd (Post 1178306)
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.

Quote:

Originally Posted by jafd (Post 1178306)
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")

Quote:

Originally Posted by jafd (Post 1178306)
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.

Quote:

Originally Posted by jafd (Post 1178306)
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.

jafd 2012-03-12 21:01

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

BTW, there is a description of the tile database structure on modRana project wiki.
Yeah, I've seen that. If the blob actually contains tile files verbatim, I think it should be easy to hack together a little Python program from looking at how you store tiles, or even to modify generate_tiles.py from Mapnik to create the SQLite databases right from the start.

Some pitfalls:

1) when populating the data for the first time, I forgot to enable hstore and use -k for osm2pgsql, and was badly screwed in terms of number of retries.

2) if you want to have not one country, but, say, two bordering countries, and hope to reduce processing time by downloading corresponding datasets from, say, download-fabrik.de — think again. Right at the border, there will be duplicate nodes on those maps. They all also contain some duplicate nodes needed to create overviews, at least capitals of other countries are mapped.

This means that importing countries one by one will fail on the second country. I don't know how to resolve this, but the easier for a human (but not for the machine) way is to download the whole continent, import it and render the bounding boxes as you like.

3) the rendering time is, too, rather slow. I wonder if using PyPy would speed it up a bit. UPD It won't, unless by some miracle PyPy supports Boost bindings.

MartinK 2012-03-13 14:40

Re: [Announce] modRana: a flexible GPS navigation system
 
Beermad replied to my PM. He is searching for the script and it should be again online soon. :)

jafd 2012-03-13 15:16

Re: [Announce] modRana: a flexible GPS navigation system
 
That's good, I already have gobs of tiles to import. :)

In short: don't muck around with osm2pgsql on a regular machine if aiming at a whole country: it would either be very long, or it will fail after quite a while trying, because you don't have enough RAM.

Use imposm, it's cool, it works in reasonable amounts of time, its documentation is good.

Then you will have the problem that osm.xml shipped with Mapnik doesn't work. This is because it's tuned for osm2pgsql, and imposm uses a totally different schema.

By the way, I don't know if OSM-Bright's default style is broken or it is the way in which imposm imports its data, but with this combination you won't get city boundaries. It might suck.

I have installed carto, went to OSM-Bright, converted their stylesheets to Mapnik's with carto, and now tiles are being rendered.

The conclusion: OSM tools are a mess.
Another conclusion: go buy a paper map or an unlimited data plan if you really value your time, and don't ever go places with poor cellular coverage.
Yet another conclusion: it's a nice idea to pre-render some large chunks of the world at all zoom levels and distribute the resulting SQLite files. Shame no one has done it yet.

jafd 2012-03-14 05:46

Re: [Announce] modRana: a flexible GPS navigation system
 
An idea worth considering: an empty tile takes 103 bytes as a file + storage overhead of a row in SQLite. At high zoom levels, OSM has lots of those. Maybe it's worth to have one more column in the lookup table to indicate an empty tile and thus process it more quickly?

MartinK 2012-03-14 15:54

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by jafd (Post 1178891)
Yet another conclusion: it's a nice idea to pre-render some large chunks of the world at all zoom levels and distribute the resulting SQLite files. Shame no one has done it yet.

If you won't mind to share some of your country/are specific database files, I think I can arrange hosting on the modRana project website for them. :) Users would then just download a corresponding database file and run the import script.

Of course a proper, more automated (building, distribution & import) solution tile package handling should be implemented eventually. :)

BTW, just got a and email from Beermad, the import script is back on-line ! :)

Quote:

Originally Posted by jafd (Post 1179195)
An idea worth considering: an empty tile takes 103 bytes as a file + storage overhead of a row in SQLite. At high zoom levels, OSM has lots of those. Maybe it's worth to have one more column in the lookup table to indicate an empty tile and thus process it more quickly?

Are they all really the same & how can they be reliably identified (eq, when downloading tiles) ? What about ocean tiles ?

So something like this ?

Code:

table tiles (z integer, x integer, y integer, store_filename string, extension varchar(10), unix_epoch_timestamp integer, empty integer, primary key (z, x, y, extension))
1 = empty
0 = nonempty

And possibly other values (like for ocean or other solid-color tiles). But that might be taking it too far & unnecessary complicating it (also something like that should be probably in the store database, not in the lookup one).

EDIT: On the other hand, solid color PNG tiles should be really small, so probably not worth the bother & database handling complications. :)

jafd 2012-03-14 17:35

Re: [Announce] modRana: a flexible GPS navigation system
 
1 Attachment(s)
Yep, empty PNGs are just 103 bytes in size. But you can take advantage of preloading one at the very start, and rendering it wherever an empty tile is needed, thus conserving some time (and battery) otherwise spent on decoding. In terms of database disk size, getting rid of them would yield next to nothing.

As for sharing the pre-renders, I suspect it would take a few months to do them on commodity hardware (three days for Poland, zoom levels all the way to 15 and 16-18 for select cities); also, to achieve acceptable results, the database for the whole planet is needed (for some reason I've got proper administrative borders only around one of two countries).

Also the stylesheet I ended up with, default one from OSM-bright (which played well with imposm data) is bad, too low contrast to be viewed on a phone. Font size is also next to pathetic.

abubakar 2012-03-14 18:18

Re: [Announce] modRana: a flexible GPS navigation system
 
I installed modrana few weeks back and recorded 3 tracks. Then I used the "show on map" feature to plot them on the maps, all 3 of them. I dont know when after that this problem started that modrana is not downloading any tiles anywhere, I have tried zooming in/out a lot, change map location, restarted the device several times, the tiles just dont load anymore and all I see is the "Loading" in each tile. What can I do to provide the debugging info so this can be debugged. I was thinking I should uninstall and install, but I have not done that yet.

MartinK 2012-03-14 22:07

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by jafd (Post 1179449)
Yep, empty PNGs are just 103 bytes in size. But you can take advantage of preloading one at the very start, and rendering it wherever an empty tile is needed, thus conserving some time (and battery) otherwise spent on decoding. In terms of database disk size, getting rid of them would yield next to nothing.

This could be implemented as an optional extension, as you would also need to know the empty-space color for the given map layer for this to work without artifacts. It would activate only provided that you know the empty space color and the database has this additional info.

It would indeed probably speed things up both in the current GTK interface - you would just draw a rectangle and fill it with solid color instead of loading an image to an image surface and then painting it. It would also make sure only real tiles are cached (the amount of cached tiles is currently limited by their count).

In the QML interface it would help too - just drawing a colored Rectangle instead of an Image element. But the performance is already very good, so it might not be that needed in this case.

To detect that a (downloaded) tile is empty, simple == comparison might be enough & pretty fast, as a different size is automatically False and comparing 103 Byte sized files should be very fast. Or just get the header, check size and don't download it in the first place, just mark as empty. :)

Quote:

Originally Posted by jafd (Post 1179449)
As for sharing the pre-renders, I suspect it would take a few months to do them on commodity hardware (three days for Poland, zoom levels all the way to 15 and 16-18 for select cities); also, to achieve acceptable results, the database for the whole planet is needed (for some reason I've got proper administrative borders only around one of two countries).

Well, thats quite brutal. But I'd say doing just some selected european countries and/or big cities might be doable.

Proper on-device realtime rendering would be ideal though - I have to finally look how the Kothic renderer actually works. I met some people on the SotM in Viena suggesting that Mapnik is horrendously inefficient so it might indeed be possible. :)

Quote:

Originally Posted by jafd (Post 1179449)
Also the stylesheet I ended up with, default one from OSM-bright (which played well with imposm data) is bad, too low contrast to be viewed on a phone. Font size is also next to pathetic.

What about the stylesheet used for the detail layer ?

At least this tools does custom rendering from OSM snapshots and uses them default stylesheet, so it should be possible:
http://osm.kyblsoft.cz/historie/
(the text in the header says that you need to select on the plus in the upper left corner to select the snapshot)

MartinK 2012-03-14 22:16

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by abubakar (Post 1179474)
I installed modrana few weeks back and recorded 3 tracks. Then I used the "show on map" feature to plot them on the maps, all 3 of them. I dont know when after that this problem started that modrana is not downloading any tiles anywhere, I have tried zooming in/out a lot, change map location, restarted the device several times, the tiles just dont load anymore and all I see is the "Loading" in each tile. What can I do to provide the debugging info so this can be debugged. I was thinking I should uninstall and install, but I have not done that yet.

There are several thinks to try:
  • 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/
If even all of the above does not help, start modrana with:

Code:

modrana
And post/pastbin the output you get. :)

jafd 2012-03-14 23:50

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by MartinK (Post 1179573)
Well, thats quite brutal. But I'd say doing just some selected european countries and/or big cities might be doable.

The countries are not a problem. But usually you don't want blank data right after the state border, that's the point.

Quote:

I met some people on the SotM in Viena suggesting that Mapnik is horrendously inefficient so it might indeed be possible. :)
The way it works currently makes me think those people are right. It issues a bloody heavy SQL query to the GIS for every 256 by 256 tile. I suspect that rendering a 2048x2048 tile in one go and then cut it into 64 256x256 tiles (think multiprocessing, again) would be far more efficient, but trying this requires quite a bit of time I don't have at the moment.

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.

Seeing demise of t@h, OTOH, I'm a bit skeptical about this one.

Quote:

What about the stylesheet used for the detail layer ?
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.

Quote:

At least this tools does custom rendering from OSM snapshots and uses them default stylesheet, so it should be possible:
http://osm.kyblsoft.cz/historie/
(the text in the header says that you need to select on the plus in the upper left corner to select the snapshot)
Let me reiterate a bit.

OSM works generally by building a geospatial database out of its input files, and schemas can be designed in different ways. The xml styles for maps are tuned to a particular schema, containing all the queries. The osm.xml shipped with Mapnik is tuned to their own database schema as produced by osm2pgsql tool, which either is dog slow or requires gobs of memory (8 GiB is way too small for Poland, let alone Europe).

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).

Joseph9560 2012-03-15 05:39

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by MartinK (Post 1178030)
Yep, Google geocoder is currently used for address search. But I'd like to add other geocoders in the near future - Nominatim, Geonames, etc. Weird that it works with Google Earth - either it uses its own different private API or there are some encoding issues with the ampersand in the string ?

Correction: The address search worked with presets online -> Custom query but not from address online.

I can see that Rana (on which modrana is based) actually uses vector data rather than tile data, any specific reason for modrana to use tile data while starting the port?

jafd 2012-03-15 07:28

Re: [Announce] modRana: a flexible GPS navigation system
 
Quote:

Originally Posted by Joseph9560 (Post 1179678)
Correction: The address search worked with presets online -> Custom query but not from address online.

I can see that Rana (on which modrana is based) actually uses vector data rather than tile data, any specific reason for modrana to use tile data while starting the port?

One reason I'm thinking about is that there are quite complex rules on which details at which sizes are to be rendered, based on a zoom level. Your average SVG files don't provide those rules, and even if they did, 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.

Maybe when the phones grow another gigabyte of RAM and a few more processing cores, these reasonings will be outdated.

jafd 2012-03-15 08:23

Re: [Announce] modRana: a flexible GPS navigation system
 
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 impact.

I also wonder how much it would be squeezed further by using png16 instead of png256. It would, of course, require a new low-color stylesheet too... And some tweaks to renderer


All times are GMT. The time now is 02:56.

vBulletin® Version 3.8.8