bryceco / GoMap

OpenStreetMap editor for iPhone/iPad
ISC License
324 stars 41 forks source link

Need a way to download just OSM objects for Offline use #794

Open kevinp2 opened 3 months ago

kevinp2 commented 3 months ago

Uploading GoMap Offline Download-540p30.mov…

I am mapping the remote Dalton Highway in Alaska, which does not have cell connectivity for much of its length.

Unfortunately, the prepare for off-line feature does not seem to reliably download all the OSM objects in the view. I will attempt to attach a video showing how this works out.

Ideally, I would like a separate button to just download OSM objects only, which are the most useful for on the ground mapping when standing next to an object.

kevinp2 commented 3 months ago

https://github.com/user-attachments/assets/a79219c5-4666-4bce-9453-7b92da737750

bryceco commented 3 months ago

The “Prepare for Offline” feature only downloads aerial imagery, not OSM data/objects. To download those you can scroll along the highway to force the objects to be downloaded.

Once you’ve scrolled away from Fairbanks a ways you should be able to zoom out fairly far, which makes this less tedious to do this.

kevinp2 commented 3 months ago

I tried this, but it turns out to be quite tedious, unfortunately:

  1. Since I don’t care so much about the aerial tiles, I switch to Editor Only.
  2. I zoom out, but I can only zoom out until the scale on the lower left shows about 1 mile. If I zoom out any further, the map changes mode and I can’t see the objects any more, and they won’t download any more.
  3. I can then scroll along the highway. But I have to stop every time to make sure that the green activity indicator completes, and then scroll again. Picture below.

After about ten minutes of patiently doing this by hand, I had maybe a quarter of the highway done.

It would be a fantastic enhancement to simply download for offline ALL the OSM objects in the current view. To me, that is what Prepare for Offline really means :-)

IMG_5144

bryceco commented 3 months ago

That would be around 100,000 square miles of data, and the way the app is architected all downloaded objects are resident in memory. It would require some testing to see what the memory footprint would be for that, not to mention the OSM server only allows downloads of 0.25 square-degrees at a time.

kevinp2 commented 3 months ago

There could be some limits enforced, particularly if you allow the user to select a rectangle. Apple Maps allows offline downloads using a user-selected rectangle up to a certain size.

bryceco commented 3 months ago

fa2b1e1eb2c13a75ae48982a1437194c0f864c91 increases the viewable area before disabling editing.

bryceco commented 3 months ago

I prototyped this (lots of hacks, nowhere close to ready for production use) and while it took a long time to perform the download the total amount of data wasn't too bad: around 600,000 objects (nodes + ways + relations) with a total memory footprint of around 450 MB. So worth doing some further investigation.