-
-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import gpx with uppercase in <desc> #9336
Comments
My research: Problem is not the Uppercase, but the name of the cache, especially the hyphen "-" in the name. The algorithm to find / extract the Geocode for the cache has problems to interpret it then and hence the description will be parsed for the Geocode. So, question is, where does the "-0" come from? Is that normal for Lab-Caches? And if yes - can this be probably ignored for the algorithm to find the Geocode? I can't probably answer that. |
AFAIK Lab Caches don't have any GC code (and never had). With the old lab caches you got an option to download a GPX file for it, but that did not include any GC code. Edit: With a slight trick, see Lineflyer's comment below, you can download a very basic GPX for Lab Adventures again, but that's only the adventure itself, no waypoints, and no "GC code". |
You can download GPX for Labs, see #9202 |
Ah, hadn't recognized that this is in GPX format, not JSON. Thanks for pointing that out. |
Thanks, I will further investigate with these information. |
Hi, this gpx is part of "community project" on https://labgpx.cz. Primary goal was to enable statistics on lab caches in GeoGet. In case of that each lab cache must have uniq GC code. To avoid conflict with existing caches we add string "-X" to existing GC code (usualy bonus). Second efect of these .gpx files (main feature for me :-)) is importing .gpx files to c:geo and use c:geo to navigate to caches, see all stages for all adventures in one prefered application and using "Adventure lab app" only for log. If you think, that the reason is "-" in GC code - why there is this problem only when there are upper case letters in desc tag? |
Edit: I will check, on how the geocode-check for labcaches can be improved ... |
That's a really cool project! |
@xjurasek See the gpx file linked in this article: #9202 (comment) - there are URL for each lab adventure, and the part after the "goto/" is unique for each adventure. This could lead to a cross-software unique identifier for each lab adventure, enabling the possibility for linking, exchanging data/status etc. Just an idea. Eg: The URL "https://labs.geocaching.com/goto/61545" could lead to an id "LC61545" (the "*" at the beginning marking it clearly as non GC-code, not only for gc.com, but for other platforms as well). |
Hi,
This shows, that GS Lab adventures is still beta version with many bugs - if you have adventure with diacritics in short name, you can't show it browser (https://labs.geocaching.com/goto/Blaník) Programmers of labgpx.cz made workaround - when downloads gpx, convert tag from uppercase to camelcase. So if it's difficult to repair parser in c:geo, you can close this bug. |
If labgpx can stay with the workaround of converting ... Or we can check, if for waypoints with URL contains "labs.geocaching.com" (or other attribute to recognize it as a lab-cache) the name is be used as geocode without further check. This happens as well, if there is no valid geocode found. @moving-bits : What do you think? |
Hi,
Same situation as in "Karel Gott". But in this file is tag in camelcase. Why c:geo imports only the last one? So camelcase helps only in some kind of situations :-(. |
I will take a look on it... Edit: So probably the best way would be for labcaches to ignore geocode-search and just use the name as geocode... |
@xjurasek: may I use the stary_prostejov-gpx for creating a test-case? So it would be here on github and probably in the releases version... I did not check yet, if the test-cases will be deployed in the released version... |
Of course you can. |
Hi,
In all examples is problem in tag desc. Original files imports only one (or two in last example) "caches". I think, that c:geo made "uniq" on lab cache name and during import "rewrites" previous record with the next one. All files (for easiest diff): |
@xjurasek Yes, you are right. c:geo uses the geocode as identifier for the cache. I don't know, why c:geo tries to find a "valid" geocode out of the gpx and does not use simply the "name"-element. Probably there were some other cache-formats, which does not have set the name correctly. @moving-bits what do you think? |
Without having looked into the source yet I imagine the following reason for parsing for a valid geocode: Each cache in c:geo belongs to a geocaching service (either online or offline). Which service it belongs to is determined by the geocode, as their namespaces are disjunct. Thus import cannot be done for a waypoint without finding a valid geocode. A possible solution could be to extend the GPX import to automatically create user-defined caches from waypoints with invalid or no geocode. |
@moving-bits ok, thanks for the information. You already proposed in #9202 (comment) some ideas how to handle the geocodes of labs, maybe with own prefix and connector. So it would not make sense to start here with a workaround (like skipping the search for a geocode for labcaches). I just thought about handle the lab cache as one cache with child-waypoints and not to create for each stage a own cache. But probably this will collide then with the "real" cache on GC (bonus cache) ... @xjurasek Try to use GC...1 instead of GC...-1 as name, that should import all caches (since the "-" rejects the name as a valid geocode and so the description will be parsed). I don't know, what following effects that could have, but at least all caches should be imported. |
Maybe for now it would help to add an option to GPX import to import all found waypoints as user-defined geocaches (and not trying to guess any geocodes). Menu option could be named "Import GPX (user-defined caches)" or something like this, to distinguish it from "Import GPX". |
I think, that first step is to find out why there is mechanism "guess geocode from other fields". Is there any comment in code or github issue? @murggel - we can't skip dash, without it we can make collision with existing caches (now and maybe later when will be actual geocaching id extended from 7 to 8 characters). |
I already looked for any reason why description etc are parsed for geocode, but did not find anything. The code is since initial commit to this repository. I guess some gpx were lacking of the geocode in the name or some other reason. @moving-bits You were right in not handling labcaches differently and guess some valid geocodes for them, but I don't really like the idea of having different "Import GPX"- options for the user. Can he distinguish, which he should use for the gpx? Probably there is a mix of different caches in one GPX. So this would mean:
|
…e then anyway the fallback) (fix cgeo#9336)
…e then anyway the fallback) (fix cgeo#9336)
…e then anyway the fallback) (fix #9336)
Describe the bug:
Importing from .gpx file with 5 points imports only the last point.
To Reproduce:
Steps to reproduce the behavior:
Actual behavior/state after performing these steps:
If I import from file LAB_KAREL_GOTT.big.gpx, I can see only one point. If I change first word in tag desc from uppercase to camelcase, import works as expected - import 5 points.
I attach 2 files (renamed from .gpx to .txt to enable upload to github):
LAB_KAREL_GOTT.big.gpx.txt
LAB_KAREL_GOTT.camel.gpx.txt
As you can see, there is difference only this tag desc.
In gpx you can see that name of cache is set to GC8XYT7-X, but c:geo imports it with GC code "KAREL" (of course in upper case variant, in camelcase works as expected).
It looks like a problem with xml parsing.
Version of c:geo used:
2020.10.29, but this problem is older.
Is the problem reproducible:
Yes
The text was updated successfully, but these errors were encountered: