pure-maps icon indicating copy to clipboard operation
pure-maps copied to clipboard

Add Option to export Bookmarks and re-import them after System Reinstallation

Open EarthlingX opened this issue 4 years ago • 5 comments
trafficstars

Is there an option thinkable to export bookmarks, enabling to avoid the need of manually adding them again after a system reinstall?

EarthlingX avatar Apr 04 '21 11:04 EarthlingX

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.

rinigus avatar Apr 04 '21 11:04 rinigus

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

ccontino84 avatar Jul 02 '23 09:07 ccontino84

At least on Ubuntu Touch the bookmarks are stored in a json file at:

~/.config/pure-maps-slim.jonnius/pois.json

boroli avatar Dec 16 '23 17:12 boroli

~/.config/pure-maps-slim.jonnius/pois.json

Or ~/.config/pure-maps.jonnius/pois.json respectively, if you don't have the slim version.

jonnius avatar Dec 16 '23 22:12 jonnius

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("&","&amp;")
        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() 

boroli avatar Jan 05 '24 22:01 boroli