alidiepuit / osmtracker-android

Automatically exported from code.google.com/p/osmtracker-android
GNU General Public License v3.0
0 stars 0 forks source link

Draw OSM map as a background for the track view #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometimes it is handy to see what streets are already mapped by OSM, to not
dublicate the work.

The best way to achieve this would be to draw the latest OSM map in
background of the track view.

I guess it would involve fetching the tiles from internet and sould be
configurable option. Also in case if the tiles are cached a "remove cache"
button is needed to force loading of newer, updated tiles.

Original issue reported on code.google.com by viesturz on 30 Mar 2010 at 12:24

GoogleCodeExporter commented 9 years ago
Hi!

Maybe I can help in the development of osmtracker-android?
I'm quite experienced with Java programming, but still newbie to android SDK.

mayeb I can try to implement this feature?

Original comment by viesturz on 30 Mar 2010 at 12:27

GoogleCodeExporter commented 9 years ago
Good idea, however requires a bit of work. I would prefer to reuse existing 
code for
managing tiles (see http://code.google.com/p/osmdroid/ or
http://code.google.com/p/andnav/ ) instead of reinventing the wheel. osmdroid 
seems
particularly interesting, but maybe a little young to be used right now.

Please feel free to give it a try and submit a patch.

Original comment by nguillau...@gmail.com on 30 Mar 2010 at 9:55

GoogleCodeExporter commented 9 years ago
From a users perspective osmdroid is quite mature and used successfully as the 
base 
for OpenStreetNav, and I think, RMaps.

I would love to see this feature because it's annoying to find out at the end 
of the 
day you were busy marking things that had already been saved when you could 
have been 
adding new data. My only input on the feature would be that this is most useful 
on a 
very close zoom. Seeing a whole long track won't particularly help, what is 
important 
is seeing street side data for RIGHT where you are --- were you could be adding 
waypoints for.

My initial idea was to implement this as a tiny map that could always be 
visible 
showing the closes view of what's at your location -- say in place of two 
buttons on 
the current screen. If it was implemented as a separate page it would need to 
be easy 
and fast to switch band and forth.

Original comment by alerque on 31 Mar 2010 at 8:45

GoogleCodeExporter commented 9 years ago
I didn't know RMaps, thanks for the pointer.

The problem with osmdroid is that it has not been released as a library, and it
forces you to include its source code in your project and be dependent of its
changes, which I don't like. But it's maybe worth the effort...

Original comment by nguillau...@gmail.com on 31 Mar 2010 at 10:01

GoogleCodeExporter commented 9 years ago
Thanks for the hints, will try out the osmdroid.

Original comment by viesturz on 2 Apr 2010 at 3:50

GoogleCodeExporter commented 9 years ago
osmdroid is under the LGPL licence. Can we include their source in this, GPL3 
project?

Original comment by viesturz on 2 Apr 2010 at 4:34

GoogleCodeExporter commented 9 years ago
Also osmdroid requires API level 4. 
It is used for the zoom controller only so it is possible to make it work on 
API level 3 with 
reasonable effort.

How do you feel about bumping to API level 4.

Also there is code for track upload to OSM....

Original comment by viesturz on 2 Apr 2010 at 6:51

GoogleCodeExporter commented 9 years ago
Don't know about the license problem, but I'm not GPL3 addict so license for
OSMTracker could be changed if needed.

I prefer to stay with API level 3 as there is still a lot of phones with 
Android 1.5. 

Maybe the openstreetmap view could be a "separate app" that can be installed
separately by the user, if he wants/have the compatible device ? The app could 
be
launched from a OSMTracker menu, and data can be shared using my recent rewrite 
of
data storage mechanism using the Android-standard ContentProviders.

Original comment by nguillau...@gmail.com on 5 Apr 2010 at 11:29

GoogleCodeExporter commented 9 years ago
Did you take a look at ContentDroyd? (I'm not affiliated in any kind with it. I 
just
use it as map provider for MapDroyd)
As far as I know, it acts as a provider for map data, so maybe it's what you 
need here.

Original comment by cku...@gmail.com on 5 Apr 2010 at 12:08

GoogleCodeExporter commented 9 years ago
Wikipedia tells that the LGPL is "GPL compatible" and can be safely distrubuted 
under 
GPL.

I have removed the parts that require API level 4 and the basic map 
fuctionality is up and 
running inside OSMtracker-android.

I all goes well, a patch should be ready in about a week.

Original comment by viesturz on 5 Apr 2010 at 12:13

GoogleCodeExporter commented 9 years ago
First patch version.

This contains the relevant part from osmdroid sources and DisplayTrackMap 
activity
that arranges the stuff.

One new activity added, one new service added for tile downloading, new 
permission
added INTERNET.

The activity shows OSM map with overlaid track and a red cross on the last 
logged
position. The track is updated from service, the map is centered on the last 
point.
Zoom in and zoom out buttons.

The zip file contains additional icons.

Original comment by viesturz on 7 Apr 2010 at 12:41

Attachments:

GoogleCodeExporter commented 9 years ago
Forgot to mention - the patch is against rev 146.

Original comment by viesturz on 7 Apr 2010 at 12:44

GoogleCodeExporter commented 9 years ago
Thanks ! However I got some problem when trying to merge:
  * The new class for service ".service.OpenStreetMapTileProviderService" declared in
the manifest seems to be missing (or should it be
"org.andnav.osm.services.OpenStreetMapTileProviderService" ?)
  * Some osmdroid classes references string resources like
"org.andnav.osm.views.util.OpenStreetMapRendererInfo" that references
"R.string.osmarender", "R.string.mapnik" ... These probably need a values.xml 
file to
be provided ?

Extra question: How much from osmdroid have you removed ? Do you think it would 
be
possible to have this working by using a JAR export of osmdroid, instead of 
including
the sources in the OSMTracker project ?

Original comment by nguillau...@gmail.com on 10 Apr 2010 at 6:02

GoogleCodeExporter commented 9 years ago
Hi!

Fixed the problems with patch.

I have removed quite a lot of unneeded stuff from the osmdroid. A whole bunch 
of demo
acitivities, track logging functions, OSM upload functions (with some thirdparty
libs), and the default osmdroid activity (that needed API 4).

It may be possible to make a Jar out of the osmdroid, but the resources is the 
tricky
part. A full JAR export may be too big, containing lots un extra stuff.

I have made several improvements to osmdroid to pull this off. They are 
submitted
upstream, but are not included yet. So taking the vanilla osmdroid would not 
work
right now.

Original comment by viesturz on 12 Apr 2010 at 7:30

Attachments:

GoogleCodeExporter commented 9 years ago
Hi, I'm one of the osmdroid developers. I like nguillaumin's idea of having the 
apps 
separate. That's more in the Android spirit than integrating another app. It 
can be 
done with intents. Just tell me which one's you need and I can integrate these. 
Or, you 
can use osmdroid as tile download service and copy the map display part. But I 
disagree 
in having another app downloading map tile that waste SD-card space. (I have 
AndNav2, 
Osmdroid and osmtracker installed, so this would be three times the required 
space)

Original comment by ThyMythos@googlemail.com on 12 Apr 2010 at 5:42

GoogleCodeExporter commented 9 years ago
Hi!

I also would like the apps separate. 

The osmdroid tile cache already is shared with andnav2. There has been some 
effort to
separate out the service. But it's still not in a working form. 

I am willing to help them, but haven't yet got any feedback from the osmdroid 
project
lead. Would hate to fork the suff.

For the view separation - it should be doable as apparently gogole maps does it.
But I have no knowledge how to publish your own java shared libs. 

Original comment by viesturz on 13 Apr 2010 at 10:45

GoogleCodeExporter commented 9 years ago
I guess neilboyd and me are the only active developers right now. The service IS
already working, though the API is not stable.

Maybe I have some time to figure out how to publish a shared lib this week...

Original comment by ThyMythos@googlemail.com on 13 Apr 2010 at 10:50

GoogleCodeExporter commented 9 years ago
I created an issue in osmdroid for this: 
http://code.google.com/p/osmdroid/issues/detail?id=43

Original comment by neilboyd on 16 Apr 2010 at 6:57

GoogleCodeExporter commented 9 years ago
At least I just took some time to test your patch, impressive work ! Thanks !

I don't know how to handle it for the moment as I'm a bit reluctant to release a
version that includes osmdroid code, or maybe I'd ask an "ok" from the osmdroid 
team
before doing that ? Do you have any though ThyMythos or neilboyd ? Thanks.

Original comment by nguillau...@gmail.com on 21 Apr 2010 at 12:13

GoogleCodeExporter commented 9 years ago
As far as I'm concerned there's no need to ask me.  As long as you stick to the 
licensing terms it's free to use.

Original comment by neilboyd on 21 Apr 2010 at 2:54

GoogleCodeExporter commented 9 years ago
I just released a new version that includes the patch, thanks very much !

Do you know if that applies with your patch :
http://wiki.andnav.org/index.php/MapTilePacks ? If yes I probably should link 
that
somewhere, it could be useful to know that you can still have OSM background 
without
3G connection.

Original comment by nguillau...@gmail.com on 1 May 2010 at 4:05

GoogleCodeExporter commented 9 years ago
Supposedly OSM cache is shared between andnav and osmdroid. But that should be
tested, if the tile packs actually work.

Original comment by viesturz on 5 May 2010 at 9:05

GoogleCodeExporter commented 9 years ago
Regarding the Show Track option showing the live OSM map - 
I've noticed that is differs from what I see on my pc.

Road that I have recently mapped are not shown when using Show Track in 
Osmtracker.

Is there some kind of cache that needs to be cleared?

Original comment by jesperfj...@gmail.com on 7 Sep 2010 at 11:01

GoogleCodeExporter commented 9 years ago
There is indeed a cache folder which should be called "andnav2" (As we use code 
from AndNav for OSM display) with "tiles" subfolder.

Original comment by nguillau...@gmail.com on 8 Sep 2010 at 10:10

GoogleCodeExporter commented 9 years ago
Maybe there should be a menu-item to clear the cache using the menu-button when 
in Track-mode.

Original comment by jesperfj...@gmail.com on 10 Sep 2010 at 11:48