Libre Mapping and GPS Navigation

Mar. 6, 2023 [technology] [guides] [libre] [privacy-security]

Some express grievance over needing SIM cards, phones and Google to navigate in unfamiliar places, but it doesn’t need to be this way. First of all, Google is not necessary to have access to detailed maps. Please check out Open Street Map. OSM data has been integrated into various other products and services, although it can be used directly for your own personal use case.

One great application which makes use of Open Street Map is Marble, which can functionally replace the spyware known as Google Earth. Marble also contains maps for temperature, precipitation and other useful formats. But let’s assume you want an anonymous “Google Earth”. Install Marble from whichever repository you use. For me, it is named marble-qt.

Open Marble, go to Settings > Configure Marble > Cache & Proxy:

Set Hard disc to Unlimited. This will save every map chunk that you look at so that the next time you view that area your computer does not need to reach out over a network to acquire data.

Then, assuming you already have the tor package installed and setup, set Proxy to:
Proxy: 127.0.0.1
Port: 9050
Proxy type: Socks5

Now your Marble will grab map data anonymously. It will load a little more slowly but remember that the next time you revisit that map area, it will be loaded instantly from your hard drive cache. No internet required.

I would also recommend changing the GPS coordinate format to Degree (Decimal) under Settings > Configure Marble > View > Angle. This seems to be the most widely used GPS coordinate type. That way you can right click anywhere on the map, copy coordinates and then plug them into your D.I.Y. GPS (which we will setup below).

Next, we want to prepare GPS functionality for your laptop or tablet. Acquire a USB GPS transceiver. They go for very cheap and do not require any service, payment, accounts or personal information to function. Just power and serial over a USB port. DYOR on which ones are most compatible with Linux and/or most performant.



Install the gpsd packages gpsd and gpsd-clients.

With the transceiver plugged in, list devices to make sure it shows up.

ls /dev

It should appear as something like “/dev/ttyUSB0 ”.

Depending on the model you bought, you may or may not have to change the output to NMEA for gpsd to read:

gpsctl -f -n /dev/ttyUSB0

Edit the gpsd configuration at /etc/default/gpsd and set:

DEVICES=”ttyUSB0”
START_DAEMON=”true”
GFSD_OPTIONS=”-n”

systemctl daemon-reload
systemctl restart gpsd

You can verify that it is up and running through gpsmon. There is usually enough signal to determine location once it has four or more satellites listed in the bottom left table with good signal, S/N.



When you revisit Marble there should now be an arrow indicator to show your location and heading. If not, Position Tracking through gpsd is configurable through Marble’s Location tab in the dropdown.

Lastly, one may want to take this GPS on the road. We can use Navit for this. Install Navit and the voice synthesizer Espeak.

Next, download OSM map data to use in Navit. This can be done through Marble (File > Download Region) or the site at Navit Project, although the site is not HTTPS encrypted.

Copy the default Navit config into place:

cp /etc/navit/navit.xml .navit/

And edit .navit/navit.xml to point to the map you just downloaded. The line can easily be found by searching for “binfile”. Append the line:

<map type=”binfile” enabled=”yes” data=”/path/to/map.bin”/>

You may need to disable surrounding mapsets since they default to enable="yes" out-of-the-box.

Also change the uncommented speech line to enable voice navigation:

<speech type="cmdline" data="espeak -s 150 %s" cps="15"/>

Now when you launch Navit, it should already be configured to source gpsd for location. It takes inspiration from commercial automotive GPS devices with things like routing, points of interest, vehicle type, avoid toll roads, etc. I recommend driving around a bit somewhere familiar at home to make sure everything is working before taking it into uncharted territory.



The best part: No definitive device association that can easily be tied back to you (especially if you can pay for the transceiver in cash or crypto). And when you’re done, you can physically disconnect the GPS. This is not just me spitballing concepts at anyone. I have personally used such a setup for several years now. It has enabled me to travel for work, and to better navigate foreign countries while still novice in their languages. All without relying on any commercial garbage that would have subjected me to tracking, paywalls and data harvesting.