osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.68k stars 1.02k forks source link

GPX import not working (1 line tags open/closed) #11278

Open krisovice opened 3 years ago

krisovice commented 3 years ago

Description

For many users, one of the main obstacles to switch from Google maps to OsmAnd is the missing ability to import Google maps favourites/starred places (personal POIs), which they have gathered over the years. Exporting starred places as GeoJSON via Google takeout, converting them to GPX file format and importing them to OsmAnd does not work. According to numerous forum posts on platforms across the globe, users would like to switch to open source OsmAnd from Google Maps and this is THE issue that's keeping them from doing it. Providing a working process to import Google maps favourites to OsmAnd could be a game changer, enabling millions to switch to an open source alternative to Google maps.

How to reproduce?

  1. Export Google maps favorites/starred places via takeout.google.com as GeoJSON.
  2. Convert GeoJSON file to GPX via e.g. mygeodata.cloud, gpxstudio.github.io or a similar tool.
  3. Rename converted file to favourites.gpx.
  4. Stop OsmAnd (Force stop)
  5. Open favourites.gpx with OsmAnd and select to import as favourites. Alternatively, copy favourites.gpx to /Android/Data/net.osmand/files folder (or /Android/Data/net.osmand.plus/files folder for plus users)
  6. Entries are not shown on the map. Selecting "Show > Favourites" or "My places" has no effect.

Your Environment

OsmAnd Version: 3.9.10 Android/iOS version: One UI 3.1, Android 11 Device model: Samsung S20 5G

Maps used (online or offline):
If you have an issue related to offline maps, tell us the exact name of the map file where the issue occurs and its edition date.

pebogufi commented 3 years ago

It is not necessary to rename a gpx file with wpt to "favourites.gpx", just use any name and open the file with a file browser. Some apps will be offered how to open it. Select OsmAnd, then "Import as favourite". Please provide an example gpx file which does not work for you, so it can be tested. You can upload it ZIPped.

dpriskorn commented 3 years ago

Here is a gpx from OSM that does not work (error message: file contains no waypoints) (version 3.9.10) generated from: https://pangose.github.io/gpx-extractor/ I presume there is an error in the GPX parser because after doing this in notepad++ it worked bild New file that works?. I wrote a question mark because on my Galaxy S5 OsmAnd became extremely sluggish after loading the file into favorites where the waypoints did show up. After restart of the app it seems to work fine and they show up on the map. No sluggishness after the restart it seems.

UksusoFF commented 3 years ago

I'm also have trouble with import gpx to OsmAnd. When try to do it - was imported only one favorite. Next replaced second line with generator data to:

<gpx version="1.1" creator="OsmAnd~ 3.9.10" xmlns="http://www.topografix.com/GPX/1/1" xmlns:osmand="https://osmand.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">

After this change import was sucessed.

dpriskorn commented 3 years ago

@vshcherb can you confirm this? Do you want to add it to a milestone?

vshcherb commented 3 years ago

the issue confirmed though we're collecting feedback about it. It's probably better to fix generator to have better formatted output.

dpriskorn commented 3 years ago

I'm using the JavaScript library here https://github.com/tyrasd/togpx, but it is valid XML and works in other places. OsmAnd should support valid XML IMO no matter the newlines.

vshcherb commented 3 years ago

Well we are using standard Android XML API, it would be quite nonsense to stop using it and though it gives a hope that it could be fixed in future Android releases

mariush444 commented 1 year ago

@krisovice there is samll tool for conversion (phyton) from kmz to gpx with icons https://github.com/mariush444/gmapIcons2osmand maybe it helps you