Serving maps locally with CoMaps

two side-by-side screenshots of the _CoMaps_ map distributor command line too

tl;dr: You can now serve map files for CoMaps from your own servers, including local ones. I made a small and simple command-line tool to help you download the maps to your computer and serve them in a local network.

CoMaps is a mobile app for Android & iOS that provides offline maps and turn-by-turn navigation – based on data from OpenStreetMap data – that forked from the Organic Maps project in the first half of 2025. Being able to fully use the maps offline makes it ideal for hiking and traveling to places where internet connectivity is spotty at best. Plus, it allows for editing OSM offline too. But, while using the maps works offline, until recently you basically needed to have an internet connection to get maps on your phone/into the app. Since mid-December, this is not fully necessary any longer.1 While CoMaps still expects to be fed the “official” maps (i.e. maps where the app recognized the checksums), you can now change where those maps come from.

By default, CoMaps still uses the content delivery network (CDN) that is hosted by the CoMaps team. This consists of a set of servers in different places, and a meta server picks the “best” connection based on geolocating the user’s IP. Then one of those remote servers will be used to download the map data. And, for the most common use cases and users (having access to stable internet in regular intervals, updating maps only on a single device, …), this works perfectly fine. But removing the previous hard-coded CDN means less reliance on a fixed set of remote servers, and flexibility for other use cases.

A big one use case for using a different server is installing and updating maps in places with limited or no internet connectivity. For example, if you have a household where you need to update the map data in more than one device and aren’t exactly having a broadband connection. In that case, downloading the same maps multiple times from remote servers, through a slow connection, is quite wasteful of your bandwidth – even more so if you are on a metered connection where you pay for traffic.2

An extended version of that limited connectivity use case are redes comunitarias (community networks), where families living in rural areas are connected to the internet via local networks that link up to the internet at certain points, and where saving communally shared bandwidth is similarly important. And another use case could be the deployment of maps in humanitarian settings, in places disconnected from the internet, but where having local maps is highly beneficial: By bringing along the APK and local map files, a single laptop could be used to rapidly deploy CoMaps and the needed maps on existing Android devices.

The other use case that comes to mind is long-term archival of maps. Until now, older maps of CoMaps3 would at some point not be able to download maps any longer, as storing all historic maps on the CoMaps CDN would be prohibitive due to the file size. As a result, while one could have archived those map files themselves, those couldn’t easily be used in the older apps, as getting them onto the devices wasn’t easy. And this goes beyond just “data backups”, historic maps and how people interacted with them is of historic/scientific interest too, so having pathways to ensure that these maps remain accessible and useable is great. Now, it’s a lot easier to just backup the old APK files alongside the maps and get them installed again.

Of course, being able to host your own maps introduces another problem: How do people download and serve them? Traversing the paths of the CoMaps CDN to get the maps isn’t necessarily easy. And standing up your own local web server to deliver the files isn’t either. Which is why I spent some time over the holidays to make a small python library that focuses on making the download and serving of those CoMaps map files as easy as possible.

At the heart of the comaps-map-distributor are three sub-commands, for downloading maps, updating local maps, and serving the maps. Using the defaults should work in settings, requiring little/no setup. And for selecting/downloading the maps, a basic, interactive interface runs people through the selection. Overall, installing, downloading and serving the maps should be as simple as using these three commands:

pip install comaps-map-distributor
comaps-map-distributor download-maps 
comaps-map-distributor serve-maps

The serve command will show the IPs that people can use in the CoMaps app to use as the remote server. The header image shows two screenshots, and you can also see a small demo video on Codeberg. When it’s time to update to newer maps (and you’re in a place with internet), one can run comaps-map-distributor update-maps, and it will update the local maps that were downloaded in the last version.

Under the hood, this little app is using inquirerpy and rich for the interface and visuals - both a first for me.4 If you’d like to help contribute/improve it, you can find all you need on Codeberg Happy map-using!

References

  1. Greshake Tzovaras, B. (2025, November 21). Mapping offline with CoMaps and Every Door. Bastian Greshake Tzovaras. https://doi.org/10.59350/8vcqj-tqe05

Footnotes

  1. So far, this only is the case for the Android version of the app. 

  2. Incidentally, this is partially my personal use case. While not on a metered connection, our home internet is rather slow, and while we don’t have a large fleet of Android devices it’s still nice to avoid duplicate downloads. 

  3. All these limitations that come with a fixed, hard-coded map delivery network also apply to Organic Maps as it is today. 

  4. Since then I made another little tool for sorting GoPro images for Panoramax 

Bastian Greshake Tzovaras

Bastian Greshake Tzovaras

Generally, things are better if you put open* in front of them.

Cite this post

Thanks to Rogue Scholar, you can cite this blog post using the DOI https://doi.org/10.59350/aj1dq-ag675.


Comments

You can use your Mastodon or other ActivityPub-based Fediverse-account to comment on this article by leaving a publicly visible reply to this associated post.

Content warnings are supported. You can also delete your comments at any time by deleting your post on the Fediverse.


This page was last built on 2026-01-05 @ 12:11:04 -0300, from git commit aef984f.

orcid scholar rss facebook twitter github youtube mail spotify instagram linkedin flickr mastodon alternative version/ more details here/