cgeo / cgeo

c:geo - The powerful Android geocaching app.
www.cgeo.org
Apache License 2.0
1.39k stars 566 forks source link

Some nitpicks about exported GPX #6348

Open steve8x8 opened 7 years ago

steve8x8 commented 7 years ago

When looking at the GPX output from c:geo for a single cache, I found a few things which may be there for a reason I don't know.

rsudev commented 7 years ago

The first item is not a problem. The uri denoting the namespace is not necessarily an existing web resource. It just uniquely identifies an xml namespace we use to place some extra information specific for c:geo. Regarding the attribute, there might be a change at GS we missed or it is possibly a crossover from the opencaching attrbute naming, not sure. Regarding the last point, I don't think that we really stand a chance of sensible results if the (essentially timeless) log dates are converted to an arbitrary timezone as date-time (8 a.m. will not save you in Australia) and assigning midnight as a time value is IMO the most conventional way to display that the time doesn't count.

steve8x8 commented 7 years ago

Are you planning to make additions to the XML namespace?

I tried to find out what's going on with attributes. On GC, /hide/sizeratings.aspx (in the cache creation process) indeed lists "Available at All Times". The attribute icon used on both the cache description page and the printable page (/seek/cache_details.aspx and /seek/cdpf.aspx) shows up as "available 24/7" . Note that the numbering differs as well (e.g., "dangerous animals" is attribute number 18 but image number 27, trouble ahead?)

Next step: move my location to the most Eastern and Western timezones and check cache hide and log dates (will they change?)...

Bananeweizen commented 7 years ago

We are not planning to make additions, we already have additions. See https://github.com/cgeo/cgeo/blob/master/main/src/cgeo/geocaching/export/GpxSerializer.java#L237 or https://github.com/cgeo/cgeo/blob/master/main/src/cgeo/geocaching/files/GPXParser.java#L1016, for instance to have a "visited" flag at waypoints.

Regarding attribute texts I'm somewhat confident the text doesn't actually matter, but only the ID. I have seen GPX files with English attribute texts, with localized attribute texts and so on, and they basically work fine (at least in the tools I use).

steve8x8 commented 7 years ago

@Bananeweizen, re namespace additions: While the GSAK NS points to a directory containing a gsak.xsd file, the CGEO NS "http://www.cgeo.org/wptext/1/0" returns a 404. (BTW the code uses NS_CGEO in one place, CGEO_NS in another. Confusing.) If there's no corresponding xsd schema file, it'll be impossible to validate a gpx file containing extensions belonging to the CGEO namespace. This doesn't affect the app itself, but im-/exported GPXes which will not pass a SAXCount check.

I'm not worried about attribute texts anymore having seen that not even GS get them right/uniform in the first place, but their numbering being undocumented makes me a bit uneasy. (Remember when they invented "medium" for "regular" and "mystery" for "unknown"? Broke quite some GPS devices around. Try to imagine what will happen if they renumber their attributes.)

I didn't have time for comprehensive tests of the timezone problem - yet, but I'll be back.

pstorch commented 7 years ago

The xml namespace URI is just a name. It is not mandatory that there is a downloadable xsd document at that address.

From https://www.w3schools.com/xml/xml_namespaces.asp:

Note: The namespace URI is not used by the parser to look up information.

The purpose of using an URI is to give the namespace a unique name.

However, companies often use the namespace as a pointer to a web page containing namespace information.