steve8x8 / geotoad

Geocaching query tool written in Ruby
https://buymeacoffee.com/steve8x8
Other
28 stars 8 forks source link

Add "corrected coordinates" information to gpx #347

Closed tintenbrot closed 5 years ago

tintenbrot commented 7 years ago

If a cache has corrected coordinates edited in geocaching.com web interface, the gpx file, downloaded with geotoad has got these coordinates in <wpt lat,lon>. - That good! But there is no information that these coordinates have been changed.

I do not know if this information is possible to parse from html, but I know where to put the information in gpx-gsak-Format (cf: c:geo Issue 4775). So adding:

<gsak:LatBeforeCorrect>51.223032</gsak:LatBeforeCorrect>
<gsak:LonBeforeCorrect>6.026147</gsak:LonBeforeCorrect>

to the gsak-extensions of the gpx file will be recognized from c:geo.

Will it be possible to add this feature?

steve8x8 commented 7 years ago

Is this a response to the tweet earlier today, or just a coincidence? I'd like to look into it, indeed, but have one or two questions (to you): (1) Is this feature limited to premium members? If so, (2) Can you provide the cdpf.aspx (print) file for such a cache, with any modification made to the coordinates? (Should also work for traditional cache, nobody wants to steal your mystery solution.) Otherwise I could try myself later. Thanks for your suggestion!

tintenbrot commented 7 years ago

I do not use Twitter so this is a coincidence.

The feature can be used also from basic members (like me). I checked the cdpf-File but can not detect the original coordinates. I also do not own a traditional cache so I provide a 1 Stage Multi:

GC3PBTF.zip

Hope you can find the information hidden somewhere.

Thanks for reply tintenbrot

tintenbrot commented 7 years ago

Just downloaded the cache with c:geo. It also includes the information. - So it must be hidden somewhere. c:geo does not use Groundspeak LiveApi.

steve8x8 commented 7 years ago

Back at the laptop, using a full-fledged browser -

(1): even as basic member, I (surprise!) can enter "corrected coordinates" - which I now did for an archived mystery cache, subtracting exactly 1 from the latitude and longitude degrees. (2): the corresponding cdpf.aspx file contains only the corrected coordinates, and bears absolutely no visible (to me) hint towards what might have been the original coordinates. Since GeoToad in most cases (all queries except GC wid) parses cdpf files (no API at all, pure HTML), the short answer to your request is "sorry, no". (2a): I now know that cache_details.aspx files contain both the old and the new location, but this information currently is not used in the context of most query types.

That's the bad news of the day.

But, perhaps there's a happy ending. I can tell you what I'm doing instead: I'm keeping a text file with waypoint names, and assigned coordinates - may be read off the GPS display during a previous attempt, or a solved mystery yielding multi-start or final coordinates. Also there's a field for a short comment (unlock code, etc.) A small ruby script takes this list, and processes the gpx file written by GeoToad, adding (!) waypoints without overwriting the original locations. That is, the cache description including the old coords doesn't get modified. In c:geo (that's what I use) you will find the additional waypoints with proper wpt types. Please check tools/solvecgeo.rb and its predecessor tools/solvemyst.rb which have been provided in the source tree for quite a while (1 1/2 yrs, 3 yrs), and certainly can be adjusted (they have diverged a bit from what I'm using now, but you may get the idea). To be run as "filters" (stdin, stdout, name of table file as only argument).

Edit: I noticed that you have replied while I was typing. What isn't clear to me: does c:geo provide both locations? (I'm aware that c:geo follows another approach, using cache_details and other pages instead. See my notes above - this currently isn't feasible for GeoToad.)

I'll leave this open for a while (knowing that the solve* tools might need an update before the next release). Thanks for digging this out! Not adding a "wontfix" tag yet - while GeoToad itself has no means to merge the requested information, the accompanying tools may provide this feature (after an update).

steve8x8 commented 7 years ago

BTW, what's the "canonical" way to do this? I've been told that c:geo would support corrected coordinates; do they get their input from gc.com, or from the user? What would an exported GPX look like?

tintenbrot commented 7 years ago

sorry for late answer, but I have been on holiday for two weeks.

c:geo does support corrected coordinates. - If a cache has corrected coordinates set on gc.com and c:geo stores this cache, the original coordinate are additionaly shown on c:geos coordinates-tab. I opened my cache GC3PBTF (cf above) and corrected the coordinates by adding 1" on gc.com website. I then stored the cache with c:geo. Both coordinates are shown! So all information is provided from gc.com only.

I will attach the gpx-file exported from this cache by c:geo.

greetings tintenbrot

screenshot_20170417-174427 GC3PBTF.gpx.zip

steve8x8 commented 7 years ago

Got it. In short: The information is in the cache_details (yours): var userDefinedCoords = {"status":"success","data":{"isUserDefined":true,"newLatLng":[50.55,8.5666666666666664],"oldLatLng": [50.54965,8.576617],"oldLatLngDisplay":"N 50° 32.979' E 008° 34.597'"}}; but not in the cdpf. It's also not in the cache_details I get (obviously): var userDefinedCoords = {"status":"success","data":{"isUserDefined":false,"oldLatLngDisplay":"N 50° 32.979' E 008° 34.597'"}};

c:geo uses a different approach to gather information - while GeoToad has focused on "printable pages" from the very beginning (which has proven to be a good idea, given the long list of changes to the details page). There's something strange I spotted: the original coordinates are labelled as point "17". Is this true only for this cache? Random number? Some kind of counter? (If a second cache with changed coords gets "18"... then perhaps "16" is the highest additional waypoint index?)

Aside from this observation: At this time it's pretty unlikely that GeoToad will change its strategy. There are bad times to come even without this :(