Difference between revisions of "User:Hessophanes/Regiohashing"

From Geohashing
imported>Hessophanes
(add region format so anyone can help)
imported>Hessophanes
(add link to example file)
Line 101: Line 101:
 
* No array declarations, just define the elements. I'm employing some crazy preprocessor constructs to include everything at the right place and still allow for regions and their corresponding subregions to be stored close to each other in the same header file.
 
* No array declarations, just define the elements. I'm employing some crazy preprocessor constructs to include everything at the right place and still allow for regions and their corresponding subregions to be stored close to each other in the same header file.
 
* I'm zealously sanitizing CGI input: the only accepted characters are [A-Za-z0-9 =.-] - if your region name contains non-ascii chars, please replace those. (%xx constructs are decoded before that, of course.)
 
* I'm zealously sanitizing CGI input: the only accepted characters are [A-Za-z0-9 =.-] - if your region name contains non-ascii chars, please replace those. (%xx constructs are decoded before that, of course.)
 +
 +
[http://130.149.11.99/hesso/Region_Europe.h Example: current contents of Europe header file]
  
 
== Feedback ==
 
== Feedback ==

Revision as of 12:03, 13 October 2008

How to fancifully display your regiohash progress

How it began...

While moving from one flat to another, I had to live without ISP for a few weeks... and as I sat there, determined to waste my time by dedicating it to some totally insane task even without internet access, I came up with this: several active regiohashers have started to create loose tables with minesweeper images showing their progress - why not take this minesweeper thing to the next level and create true regiohash minesweeper boards?

After doing a first proof-of-concept using only a shell script and the wonderful ImageMagick toolset (which took almost 8 seconds to render a full Australia board) I did it once again with a speedy language (read: C).

As it is prohibited to directly reference foreign images from wiki sites, interested users have to query the CGI themselves, copy the image into the wiki and include that in their page.

How to use it...

Enter this URL:

http://130.149.11.99/hesso/xkcdregio.cgi?region=YOURREGION&subregion=YOURSUBREGION&visited=GRATICULELIST

Only the region= parameter is strictly necessary. subregion= adds more fun for large nations, as it gives you something that's not totally impossible to complete. visited= takes a list of lat.lng pairs, themselves also separated by dots, so you may have to write a long list if you're a geohashing addict.

E.g.:

http://130.149.11.99/hesso/xkcdregio.cgi?region=Germany&subregion=Brandenburg&visited=52.13.52.12

There are a few experimental features:

You can enter a start=YYYYMMDD date denoting the first graticule visit of your (sub)regiohash attempt. This adds a day counter but is probably useless unless this becomes a wiki extension.

Instead of enumerating visited= yourself, you can ask the CGI to parse your userpage, assuming you have a link to every one of your expeditions there (and no links to other people's - I'll come up with an idea to include/exclude groups of links): just set wikiuser= instead.

So the example above could be changed to:

http://130.149.11.99/hesso/xkcdregio.cgi?region=Germany&subregion=Brandenburg&wikiuser=Hessophanes

So, go ahead and play with it. But please keep in mind: this is a university server. Play nicely.

What it looks like...

Again with myself as example:

example regiohash

What it still lacks...

This is a (likely not exhaustive) list of things I'll add/change in the next weeks:

  • When autoparsing, the CGI doesn't check which (sub)region a visit completes - it simply marks the graticule as "visited" for all possible regions (thanks relet for pointing this out)
  • Add a special sign for the home graticule, add a parameter home=lat.lng and try to parse this from the ASG tag if wikiuser= is given
  • Add a second counter at top left for visited/remaining graticules
  • Improve error reporting (anything is better than HTTP 500)

List of available regions

I'm sorry for having so little data, but I wanted to have working code first. I wouldn't even have Australia if it weren't for UnwiseOwl's Australia map project which allowed for easy conversion to my format.

Region Subregion
Germany Schleswig-Holstein, Niedersachsen, Mecklenburg-Vorpommern, Sachsen-Anhalt, Nordrhein-Westfalen, Brandenburg,

Thueringen, Sachsen, Hessen, Rheinland-Pfalz, Saarland, Baden-Wuerttemberg, Bayern, Berlin, Bremen, Hamburg

Australia Western Australia, Northern Territory, South Australia, Queensland, New South Wales, Victoria, Tasmania, Australian Capital Territory

How to add regions

If someone wants to lend a hand, great! I'd prefer email submissions to <jckn@gmx.net> (that address is already heavily spam-infested, obfuscation would be futile)... the format is (just making up an example here):

 {"RegionName", "TAG", (lat-top), (lat-bot), (lng-left), (lng-right),
  "oooooo00oooo" \
  "oooo0000000o" \
  "ooo00000o000" \
  "ooo000000000" \
  "oooooooo000o"},

/* ... */

 {"SubRegion1", "ST1", "TAG",
  "oooooo00oooo" \
  "oooo###0000o" \
  "ooo####0o000" \
  "ooo###000000" \
  "oooooooo000o"},
 {"SubRegion2", "ST2", "TAG",
  "oooooo##oooo" \
  "oooo00#####o" \
  "ooo000##o000" \
  "ooo00###0000" \
  "oooooooo000o"},
 {"SubRegion3", "ST3", "TAG",
  "oooooo00oooo" \
  "oooo000000#o" \
  "ooo00000o###" \
  "ooo0000#####" \
  "oooooooo###o"},
  • The tags should be at most three chars long - they are currently not exposed, but I wanted to keep the option open to add small pictograms/flags/labels in the top bar.
  • The second tag of the subregion should match the tag of the corresponding region.
  • No array declarations, just define the elements. I'm employing some crazy preprocessor constructs to include everything at the right place and still allow for regions and their corresponding subregions to be stored close to each other in the same header file.
  • I'm zealously sanitizing CGI input: the only accepted characters are [A-Za-z0-9 =.-] - if your region name contains non-ascii chars, please replace those. (%xx constructs are decoded before that, of course.)

Example: current contents of Europe header file

Feedback

... per IRC or talk page, as usual.