Yep. It's a binary file. It uses little-endian encoding (least significant byte in the smallest address). The coordinates are 64-bit floats (i.e. double-precision) The three least-significant bytes of them are always null.
Here's a short python script that would modify the Waypoint.gtk file with new coordinates. I haven't been able to write over the other Waypoint.gtk file, but I don't know if it's the GPSr or my computer preventing it.
Here's a short python script that would modify the Waypoint.gtk file with new coordinates. I haven't been able to write over the other Waypoint.gtk file, but I don't know if it's the GPSr or my computer preventing it.
Code:
import struct
# 0x18 0x30 0x48 0x60 0x78
coords = {
0x18: (31.49685, 65.8421), # some geocache in afghanistan
0x30: (42.86268, 0.60267), # some geocache in france
0x48: (-23.12289, 43.62993), # some geocache in madagascar
0x60: (-33.81278, 24.89653), # some geocache in south africa
0x78: (45.27842, -74.0926) # some geocache in canada
}
with open('Waypoint.gtk', 'r+b') as file:
for addr in coords:
lat, lng = coords[addr]
file.seek(addr)
file.write('\0\0\0' + struct.pack('<d', lat)[3:])
file.write('\0\0\0' + struct.pack('<d', lng)[3:])(27.04.2014, 12:52)Oluffen Wrote: Sorry for my limited knowledge in this area, but what does this mean? Does it gives us a clue of how to interpreat the file to get us the waypoints in a standard format?
Regards,
(26.04.2014, 18:21)throwaway Wrote: I don't know about the file you specified, but I have been trying to figure out how I could edit Waypoint.gtk to use this thing for geocaching. Made a breakthrough today, and decided I didn't want my top Google result for trying to figure this out to not to have any good info. It uses a 64 bit floating point format for latitude and longitude.
Lat-Lng pairs are (relative addresses in that file):
* 0x18, 0x20
* 0x30, 0x38
* 0x48, 0x50
* 0x60, 0x68
* 0x78, 0x80
The four bytes (out of eight) that immediately follow each pair look like they could be a 32-bit UNIX timestamp, but for some reason they're all the same for me, at least in the Waypoint.btk file.
