pure-maps
pure-maps copied to clipboard
Add Option to export Bookmarks and re-import them after System Reinstallation
Is there an option thinkable to export bookmarks, enabling to avoid the need of manually adding them again after a system reinstall?
Already now you should be able to use MyBackup to backup all settings on SFOS. But yes, maybe some additional export/import would be useful.
I'd like to transfer my bookmarks to my PC, is there a way to achieve it? I just don't know where the data is stored on the phone. KML import/export would be very nice
At least on Ubuntu Touch the bookmarks are stored in a json file at:
~/.config/pure-maps-slim.jonnius/pois.json
~/.config/pure-maps-slim.jonnius/pois.json
Or ~/.config/pure-maps.jonnius/pois.json respectively, if you don't have the slim version.
Please find a quick'n'dirty python file to convert the json file into a gpx file. There might be much more elegant ways, but at least this works and I can use my POI's in other applications:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
logfile = open("pois.json", "r")
loglist = logfile.readlines()
outputFile = open("pois.gpx", "w")
header = """<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.0" creator="PureMaps"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.topografix.com/GPX/1/0" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
"""
footer = """</gpx>\n"""
outputFile.write(header)
reset = False
for i in range(len(loglist)):
myLine = loglist[i].split(":")
tmp = myLine[0].strip()
if tmp[0] == '}':
reset = True
if tmp == '"title"':
title = myLine[1].strip()[1:-2]
title = title.replace("&","&")
if title == "": title = "None"
if tmp == '"x"':
lon = myLine[1].strip()[:-1]
if tmp == '"y"':
lat = myLine[1].strip()
if reset:
outputFile.write('\t<wpt lat="'+str(lat)+'" lon="'+str(lon)+'">\n')
outputFile.write('\t\t<name>"'+title+'"</name>\n')
outputFile.write('\t</wpt>\n')
reset = False
outputFile.write(footer)
logfile.close()
outputFile.close()