geeksville / Gaggle

An Android application for glider pilots
http://groups.google.com/group/gaggle-users/
33 stars 16 forks source link

Create background map to archives #90

Closed hansvdam closed 11 years ago

hansvdam commented 11 years ago

There's a lot more fixed than only what the title suggests, but the title shows what's on the surface. I also restored the theme-switching functionality, and the retention of the selected tab, when going back and forth between the app and the preferences. When the them is changed it restarts the activity in onActivityResult of TopActivity. this was how it was already. I could imagine that it is a bit of a crude way to enforce a new theme. Moreover, it meant saving the current tab was also a bit more of a hassle. Anyway it all seems to work now, AND like the title says, there's an interesting extra option at the bottom of the archives-selection menu....

dkm commented 11 years ago

Hey !

Can you explain what is this "use background online source" doing ? I have trouble understanding the feature... Is it used to enforce priority for one source over the other ?

Also, could you do a simple refactoring ? I think some Background are missing their 'g' : backround ... :)

Thanks!

hansvdam commented 11 years ago

Hi Marc! Refactoring done ;) I didn't know how to describe it in a short sentence, but when you select an archive you may get dioriented, because outside of the archive you only have the raster. This option puts the opencyclemap as a background to the selected archives, so you knwo where you are on the map when e.g. postion is not within the archive. Background thus has nothing to do with computer-processes, but is meant visually: on the background. Just try and you'll see. Hans

dkm commented 11 years ago

ahhhhhh, this makes complete sense now ! :) Do you think it would be possible to create a very lightweight archive that we ship with gaggle, so that we always have something meaningful to display when no real tiles are available (no network, no archive) ? An archive with country borders for example. I know my garmin GPS has this feature for example

hansvdam commented 11 years ago

That might be possible, but i think that for a reasonable area to cover at a number of zoomlevels in bitmap, it would quickly make the app quite big. For garmin this is no problem, but for an app size matters. What we could do is make a dowloadable archive that fulfills this role. But if we include this in the app, the app would become big. I think for now i think my current solution is adequate. I found it hard, however, to express it's functionality in a menu caption. Do you hsve an idea?

hansvdam commented 11 years ago

On second thought... I think I've been a bit quick in my comment above. I'll first try how bad/big it would be. Maybe it is not so bad (couple of megs extra) and it's a good idea to have a background that is there even offline. I think I have time this afternoon to try.

hansvdam commented 11 years ago

The world is big, I'm still figuring out how to stay within let's say 2 or 3 megs for the whole world, even though it has little more than country borders. It's not vector graphics, so I' trying to crunch the bitmap to as little bits as possible... But even then, packaging a world-map-background wihtin the app will make the app much bigger (it's 800 k now). Personally I'd say so be it, but what is your opinion on that?

hansvdam commented 11 years ago

Ok, so I've managed to squeeze the entire world into 810K in black and white. I think that suffices. I think it would still be usefull too keep the other option with the online background too, just because the squeezed map is really coarse. What do you think? device-2012-12-21-223713 Anyway I need to do some more work, but please let me know.

hansvdam commented 11 years ago

Hi Marc, So I've added a fixed world map to the the archives. It is stored in the assets, so for Gaggle beta it also has to be copied into the gaggle beta assets. I have preserved the option in the archives to choose an online background with a higher resolution (I've choosen the open cycle map, which I think is the best free online map for flying as it has terrain, but also shows forest and roads). I have also added a number of zoom levels to the archives (in the zoomed out direction, i.e. high level) on

http://hansvdam.github.com/GaggleDocumentation/archivemap.html

because these archives otherwise are invisible when zoomed out. To Achieve that I have also made a mbtiles archive merger, because I did not wanted to just add these zoomlevels to existing archives. Unfortunately I could not find a proper existing merger for mbtiles archives, so I built one myself. It is at:

https://github.com/hansvdam/MBTilesProcessor

I will make it a bit more generally useful, so it can be used to merge any number of mbtiles-archives into one.

Please let me know if it all works...

Merry Christmas ;) Hans

dkm commented 11 years ago

Sorry for not getting back earlier... It's a bit difficult during this period of the year :) I think all you did is great ! I still have some questions... What are you doing with the merging tool exactly ? IIUC, from gaggle, we can select only one archive at once... So for example, if I want to cover all the french alps, I will have to download several archive and then merge them. Am I correct ? If so, then we should also provide fat archives: french alps for example (from nice to geneva). I know this will create big files, but we should assume that some users have storage for that :)

As for the default background, it's still better than the grey-grid ! I'll merge that and publish an updated beta package when I have the time. We should also think of an UI from gaggle to download corresponding archive :)

hansvdam commented 11 years ago
Hey Marc,
  No you can just select mutiple archives from gaggle, no problem.
  For myself I just wanted to combine archives of the same area but
  different zoomlevels, but having written that I thought I might as
  well go the exgtra length and make it into a general merger, but
  that's not finished yet. So it is not particulary neccessary or
  even usefull to create fat archives. It  just might be convenience
  in some imaginary scenario ;) (e.g. somebody says an extra strip
  added to an archive, than you don't have to download the whole
  archive again, but you can just download the are of this one
  mountain and add it to the archive...).
  On 27-12-2012 15:43, Marc Poulhiès wrote:

  Sorry for not getting back earlier... It's a bit difficult
    during this period of the year :)
    I think all you did is great ! I still have some questions...
    What are you doing with the merging tool exactly ? IIUC, from
    gaggle, we can select only one archive at once... So for
    example, if I want to cover all the french alps, I will have to
    download several archive and then merge them. Am I correct ? If
    so, then we should also provide fat archives: french alps for
    example (from nice to geneva). I know this will create big
    files, but we should assume that some users have storage for
    that :)
  As for the default background, it's still better than the
    grey-grid ! I'll merge that and publish an updated beta package
    when I have the time. We should also think of an UI from gaggle
    to download corresponding archive :)
   —
    Reply to this email directly or view
      it on GitHub.