Some Bits: Nelson's log

3 posts in January 2011

Spot XML data

I got a Spot for Christmas. In addition to emergency use they have a tracking option where it records your position via satellite every 10 minutes, live. The website is awful and they don’t keep your data very long, but the data is there. And they have an API of sorts. Related search: [findmespot completexml]. Some notes:

  • You can get an XML view of a public shared page by going to a URL like http://share.findmespot.com/messageService/guestlinkservlet?glId=NONCE&completeXml=true. The NONCE is the same blob that’s in the glId tag in the public shared page.
  • Data comes in a custom XML format. It’s pretty simple, each message is an XML blob with a latitude, longitude, and timestamp (in some random timezone!). Also some other junk.
  • The data is cached and only updated every 15 minutes. I’ve been told there’s more latency than that.
  • The shared page only shows data for the last 7 days.
  • Spot keeps your data for only 30 days. There’s also a manual download option.
  • Spot has a fancy site for hosting trip diaries at http://www.spotadventures.com. It includes KML and GPX downloads, photos, notes, etc. It looks like a pretty complex and featureful product with very few users.

I haven’t found any sort of hacker community for Spot. There is at least one third party service, though: Spotwalla.

Sort of related: Spot’s new system includes a “Type & Send” feature where you can send arbitrary 41 character messages via the satellite network. They charge $0.10/message in bulk.

Usenet encoding technologies

Back in 1993 I ran a Usenet server. Usenet’s mostly dead now but there’s a lively trade on  Usenet still in pirated media, particularly pornography. The challenge is posting a 1 gigabyte .AVI file in a medium that’s limited to small text files. Here’s some of the tech in use these days:

  • nzb, a metadata file for downloading a large file spread across multiple posts. It serves a function analagous to .torrent files in BitTorrent; doesn’t contain any content, but describes content. There are Usenet search engines that return NZB files, you can then take one to download the actual release off your favourite NNTP server.
    An NZB file is an XML document that describes a set of files which, when combined, make the release. Each file is described by a Usenet group and a list of segments. Each segment is a single Usenet message, named by Message ID. (Note: you can’t create the NZB file until after all the message parts have been uploaded).
  • rar, a compression format. It’s like zip, but tighter. Rar also does multipart well.
  • par2, an error correcting code format. Sort of the opposite of compression; transmit redundant data so a large archive can be rebuilt even if a few little pieces are missing.
  • uuencode, the historical encoding of binary data for Usenet. It’s a base 64 encoding with some very primitive file wrapper stuff. Still in use.
  • yEnc, the modern encoding of binary data for Usenet. It’s a full 8 bit encoding with escaping for a few characters (NULL, LF, CR, =). It also has a simple file wrapper and the ability to split a file amongst multiple messages. yEnc seems like MIME-lite, not sure what problem it solves that MIME can’t do.
  • sfv files are checksums on other files, used to verify your parts.
  • nfo files are text files (well, ansi graphics), typically a README from the release group.

I took a close look at a single NZB for a 300MB AVI file. Here’s what it contains:

  • 15 files: an SFV, a PAR2, 6 .RAR parts, and 7 PAR2 pieces.
  • Each RAR part is 50 megs and consists of 201 segments of length 249600.
  • The encoding makes each RAR file 70 megs on the server. Last chunk is smaller, total RAR text size is 410MB.
  • The PAR2 chunks total another 40MB.
  • It’s roughly 450MB to post a 300MB AVI to Usenet, or 50% overhead.

Here’s some Windows software I found useful:

  • GrabIt, a free NNTP client that’s good at downloading large binaries. The client is free and will download any NZB you give it, but they really want you to pay $25/year to use their NZB search engine.
  • QuickPar takes a PAR fileset and assembles the single file out of its components.
  • YEnc Power Post seems to be what people posting to Usenet use, but I can’t find a canonical linkf or it I trust.

What I’m missing is a reliable, free NZB search engine. There’s a variety of for-pay options of varying levels of sleaziness. binsearch.info is promising.

Short names for lat/long points

I want short names to refer to a specific latitude/longitude. Mostly so I can type them easily into an aviation GPS. For my purposes I need accuracy of about 1 mile, so 1 minute or .01 degree. I only need coordinates valid in the continental US, bounded roughly by 20, -125 to 50, -65. Some options, with the encoding for San Francisco (roughly at 37.75, -122.34).

  • 377512243. Lat/long base 10. 9 characters per location, and dead-ass easy to understand.
  • 9q8yvv. Geohash, a hierarchical base 32 encoding. 6 characters per location. See here for visualization.
  • KO46D. “Grid Fixes” from FltPlan. 5 characters per location. Can’t find documentation but it seems to have a resolution of 10 minutes latitude, 1 degree longitude. Not really accurate enough.
  • CM87SR. 6 characters per location. Grid Squares, aka Maidenhead Locator System, a ham radio thing, here’s a map view. Accurate to 2.5′ latitude and 5′ longitude, or roughly 4 miles, so not good enough for my purposes. There is an 8 character extended locator option.
  • ?????. Perfect rectangular coding, base 32. 5 characters per location. Need (50-20)*60 = 1800 = 11 bits of latitude, and (125-65)*60 = 3600 = 12 bits of longitude. 23 bits can be encoded in 5 characters in a base 32 representation. A base 52 representation would get it down to 4 characters.

I think if I were actually building this I’d probably go for Geohash. It has a nice property that you can specify arbitrary precision, then lop characters off the right to make a shorter code that’s less specific.