[Geowanking] Location encodings, URL schemes
maym at foobar.lu
Thu Feb 17 14:43:36 PST 2005
Doesn't sound like a crap idea to me :) I would think that this has been
discussed before, too, but I can't find any references to it.
I think that you should go ahead and build a prototype for it (a Firefox
extension maybe?). Shouldn't be too difficult. It could have a
configuration dialogue that lets you specify what to do with the
lat/long (fire up external up and pass in parameters, or go to a URL
with the lat/long in the query string). The hard part will be getting
people to use it. Standardizing it might help, so maybe you should do a
write-up and submit it to the W3C?
Andy Armstrong wrote:
> Somebody please tell me either that this already exists or suggest why
> it shouldn't :)
> Start with a compact alpha-encoded representation for a latitude,
> longitude pair. I think this was discussed recently - basically you'd
> encode each as a base 26 fixed point number using letters as digits
> and then interleave the latitude and longitude string so that
> 'astbfqklzp' would be a more precise encoding of 'astb'. Psuedocode
> Now define a 'geo:' URL scheme that uses that representation as the
> The location is <a href="geo:astbfqklzp">here</a>
> Clicking on a link would take you to a map but it'd be /your/ choice
> of map rather than the author of the original page's choice of map.
> You could, for example, set things up so that clicking on a geo: URL
> fired up your route planning software and started a new route with
> your home as the start point and the location described by the link as
> the destination.
> I'm sure somebody must have discussed this before. Or maybe it's just
> a crap idea :)
>  Psuedocode implementation of the encoding scheme:
> limit(x, min, max, mod)
> while x < min
> x := x + mod
> while x >= max
> x := x - mod
> return x
> encodeAngle(angle, prec)
> angle := limit(angle, 0, 360, 360) / 360
> enc := ''
> while prec-- > 0
> angle := angle * 26;
> digit := int(angle)
> angle := angle - digit
> enc := enc + ('a' + digit)
> return enc
> interleave(a, b)
> if a = '' or b = ''
> return ''
> return left(a, 1) + left(b, 1) + interLeave(mid(a, 2), mid(b, 2))
> encodeLocation(latitude, longitude, prec)
> lat = encodeAngle(latitude, prec / 2)
> lon = encodeAngle(longitude, prec / 2)
> return interleave(lat, lon)
More information about the Geowanking