Meshtastic-Android icon indicating copy to clipboard operation
Meshtastic-Android copied to clipboard

Support off-line maps

Open geeksville opened this issue 5 years ago • 28 comments

geeksville avatar Apr 22 '20 23:04 geeksville

This issue has been mentioned on Meshtastic. There might be relevant details there:

https://meshtastic.discourse.group/t/offline-maps-on-meshtastic/137/3

geeksville avatar Apr 22 '20 23:04 geeksville

I would suggest the usage of OsmAnd. The only job to be done would be to integrate the "aidl interface", of Osmand. https://github.com/osmandapp/Osmand/blob/master/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl#L445

Here you can find an example for Telegram integration https://osmand.net/blog/osmand-telegram-released

aHVzY2g avatar Jun 11 '20 12:06 aHVzY2g

This issue has been mentioned on Meshtastic. There might be relevant details there:

https://meshtastic.discourse.group/t/offline-maps-on-meshtastic/137/21

geeksville avatar Jun 12 '20 12:06 geeksville

@geeksville did you already had a thought, which "OfflineMap integration" would fit the scope of the project best?

aHVzY2g avatar Jun 26 '20 09:06 aHVzY2g

@aHVzY2g Mapbox as a really nice and easy looking API to turn on off-line maps. I just didn't call it ;-). So I'd say the "low hanging fruit" solution is for someone to just use the mapbox version.

Porting to some other API would be fine if someone wants to do that and it provides the same level of polish. But the docs for mapbox are super good and it was super easy to for me add maps with their api. the last time I looked at OsmAndroid it was much more rough - but that was for a project like 6 yrs ago (andropilot and droneshare) so it has probably gotten better.

geeksville avatar Jun 27 '20 05:06 geeksville

Please consider non-urban areas when looking at map examples. Many maps which look very cool in cities end up being completely blank in areas with no roads. OpenStreetMap, which is the source OsmAnd primarily draws from, only has 1 layer (of 5) which shows useful details when there are no roads. If OSM sources are selected, please consider using the Cycle Map layer if no other robust data sources are layered over the basemap. Otherwise, people hiking might find this is all the map shows, which is the 4km surrounding my home:

Screenshot_2020-07-11 OpenStreetMap(1)

Example in the Meshtastic forum.

jetatomic avatar Jul 11 '20 23:07 jetatomic

Offline Maps would seem to be a key feature for the idea of meshtastic. OsmAnd or the principle of OsmAnd could be a viable alternative, as well as having in app capability to download and store maps when online and use them when offline. QGroundControl has a similar feature like this, where you can use basically any source, vector or sat maps, create a box and it will download all resolutions you specify (and have available space).

chron0 avatar Aug 10 '20 13:08 chron0

@chron0 It might be easier to initially just turn on offline maps in our current mapbox client. If you want to work on this, here's a plausible pointer: https://docs.mapbox.com/help/troubleshooting/mobile-offline/

geeksville avatar Aug 10 '20 15:08 geeksville

I'll have a look but, although the mapbox stack is potent/competent, I never liked their closed box model. A couple of years back I was saddling this horse the other way around: https://apollo.open-resource.org/lab:dspace - but in the end we failed at the challenge of the distributed data layer. meshtastic could proof to provide this kind of basis the other way around where we could map communication/data in a decentralized (mesh) fashion as "overlays" onto an available basemap, at least for the basic "slow" communication/data subset, not for "everything" but for the most basic/emergency/off-grid needs.

chron0 avatar Aug 10 '20 18:08 chron0

Additional link to MapBox API calls for offline maps: https://docs.mapbox.com/android/maps/overview/offline/

DingoOz avatar Sep 07 '20 12:09 DingoOz

Tried this, but the downloaded maps do not work in the Meshtastic app. Osmand is the nicest non ATAC mapping app I have found.

cjgemm avatar Jan 22 '21 01:01 cjgemm

This issue has been mentioned on Meshtastic. There might be relevant details there:

https://meshtastic.discourse.group/t/can-the-app-use-other-maps/246/6

geeksville avatar Mar 10 '21 01:03 geeksville

As a "power user" of Osmand, it is definitely far ahead of ATAK. And as for data sparsity, enhanced mapping data (tiles, POIs, routing, etc) can be downloaded from opensupermaps.com and placed in Osmand's working directory. With this dataset Osmand becomes the best offline mapping software available IMO.

joshbowyer avatar Jan 24 '22 14:01 joshbowyer

@geeksville are these docs up to your standards?

https://github.com/osmdroid/osmdroid/wiki#kotlin It would be awesome if this could be done for #6's sake as well.

Mhowser avatar Jan 30 '22 13:01 Mhowser

Sure, if someone wants to send in a PR to do this then I think that would be great!

geeksville avatar Jan 30 '22 22:01 geeksville

I am trying to commission a person on Fiverr to do this.

Mhowser avatar Jan 31 '22 05:01 Mhowser

I dont know how Fiverr works but is it something where users like me could donate to a bounty pool? I personally know some other people aside from just myself who would be willing to pay for this to be made

joshbowyer avatar Feb 22 '22 22:02 joshbowyer

Have you had any luck?

joshbowyer avatar Mar 19 '22 01:03 joshbowyer

No, all devs that I contacted there basically told me its too complicated. I could ask more devs but most of them are out of my budget.

Mhowser avatar Mar 19 '22 10:03 Mhowser

May I ask what the budget is? Because Im serious about wanting to pitch in with a few people, we could discuss it via email too if youd prefer

joshbowyer avatar Mar 19 '22 11:03 joshbowyer

My budget was around 200 at the time, but since then I had to spend over half my savings due to mandatory life style changes. So I'm afraid I won't be able to contribute for quite a while.

Mhowser avatar Mar 20 '22 16:03 Mhowser

I am looking to put forward a few thousand.

Email me at [email protected] and we can discuss more

joshbowyer avatar Mar 20 '22 16:03 joshbowyer

@andrekir @geeksville I highly suggest you take advantage of this opportunity.

Mhowser avatar Mar 20 '22 16:03 Mhowser

I ended up making a prototype of offline-maps using MapBox. It was merged in with PR #391 and was linked to Issue #359 .

It is a "developer only feature" right now and is very limited in its functionality.

The main issue is MapBox's API limits for the free tier, as well as the Terms of Service which prevents users from downloading the tilesets and keeping them stored permanently. You must fetch the tilesets before going into a region with no cell coverage. It essentially "pre-loads" the tilesets in cache and allows you to view the specified region when you need it. (As long as the application is still open and has not been closed)

Ideally, a transition away from MapBox would be the best solution to this problem. But that has its own set of issues, namely performance on older devices, actually setting it up in the application, and other unknowns.

PWRxPSYCHO avatar Mar 20 '22 17:03 PWRxPSYCHO

Please look at Osmand/OSM. The issue youre running into is the same issue PureMaps has been having; due to limited API calls theyve had to remove nearly every tile server they had.

joshbowyer avatar Mar 20 '22 17:03 joshbowyer

I could probably take this on, but it won't be a quick turnaround as I would be doing this in my free time lol. I would also need to talk with the other devs on the project and see if this would be a viable solution before I spend too much time working on something like this.

PWRxPSYCHO avatar Mar 20 '22 17:03 PWRxPSYCHO

Something like Meshtastic will only unfold its true potential when it can work without any online dependency. So integrated offline-maps coming from OSM and/or re-using OSMAnd map downloads and serving it locally in app, or providing its own tileserver that the client app can use as a drop-in replacement would be awesome.

chron0 avatar Mar 20 '22 17:03 chron0

Would interfacing with the osmand API be a valid solution?

This is an example app, and the readme has the list of commands with their arguments and explanations: https://github.com/osmandapp/osmand-api-demo/tree/master/OsmAnd-api-sample

It seems like addMapMarker(), updateMapMarker() and removeMapMarker() could be used to draw, update and remove the locations of other nodes, which would be great for initial functionality. It also seems like there are enough features available to extend the functionality quite a bit down the road.

If osmand is available as an option for mapping, it might make sense to replace the mapbox functionality with a list of nodes and their GPS coordinates? The app would be fully functional without the internet, and the coordinates would be easy to reference and punch into other GPS devices.

EDIT: Apparently this file helps with integration https://github.com/osmandapp/Osmand/blob/master/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl

prurigro avatar Aug 05 '22 01:08 prurigro