User:Hessophanes/Regiohashing

From Geohashing
< User:Hessophanes
Revision as of 03:02, 29 October 2008 by imported>Hessophanes (Add a list of all the maps I have to add once I find a few spare hours.)

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...

The request URL looks like one of these:

http://130.149.11.99/hesso/xkcdregio.cgi?region=YOURREGIONS&visited=GRATICULELIST&home=HOMEGRAT&started=FIRSTHASH
http://130.149.11.99/hesso/xkcdregio.cgi?region=YOURREGION&wikiuser=WIKIUSER&started=FIRSTHASH
  • Common parameters
    • region=Regionname: This is the only mandatory parameter. It takes a colon-separated list of regions. The first one determines the size and shape of the board and has to be the outermost. You may continue the list with successively smaller subregions, but you have to list them without omissions (i.e. region=Europe:Vlaanderen won't work, but region=Europe:Belgium:Vlaanderen will). In order to keep the list short and readable you can use ISO-3166 abbreviations.
    • start=yyyymmdd: If you enter your first visited geohash for this regiohash attempt, a day counter will be added in the top right corner.
      • home=lat.lng: If you want, you can specify your home graticule. If you have visited a geohash there, it will be marked with a green flag instead of a red one.
  • Progress parameters
    • Manual
      • visited=lat.lng.lat.lng....: This is your list of visited graticules (which might become very long as time flies by).
    • Automatic
      • wikiuser=User: This makes the CGI script attempt to automagically parse your wiki userpage for your home graticule (by looking for an {{ASG}} tag) and your visited geohashes (by including all links that match [[\d{4}-\d\d-\d\d[_ ]-?\d{1,3}[_ ]-?\d{1,3}|). This has some intrinsic weaknesses, though - see below.

E.g.:

http://130.149.11.99/hesso/xkcdregio.cgi?region=Germany:Brandenburg&visited=52.13.52.12&home=52.13
http://130.149.11.99/hesso/xkcdregio.cgi?region=EU:DE:BR&wikiuser=Hessophanes

Go ahead and play with it, but please keep in mind that I'm hosting this on a university server. Play nicely.

What it looks like...

Again with myself as example:

example regiohash

  • The counter in the top left corner shows the remaining graticules of the smallest (sub)region that hasn't been completed yet.

What it still lacks...

  1. The tool does not (and will never be able to) know which (sub)region a certain geohash visit pertains to. It would need full Google and DJIA data to accomplish that. Still wikiuser= is not completely useless - I'll add a parameter notvisited= so you can still benefit from the comfort of the parser and correct its mistakes.

List of available regions

All this wouldn't have been possible if it weren't for all the submitters who have provided me with maps of regions that would have taken me days to chart... thank you!

Region Subregion submitted by
Germany Schleswig-Holstein, Niedersachsen, Mecklenburg-Vorpommern, Sachsen-Anhalt,

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

Hessophanes
Netherlands Friesland, Groningen, Noord-Holland, Drenthe, Overijssel,

Flevoland, Utrecht, Gelderland, Zuid-Holland, Zeeland

Arvid
Belgium Vlaanderen, Antwerpen, Limburg, Oost-Vlaanderen, Vlaams-Brabant,

West-Vlaanderen, Wallonie, Brabant-Wallon, Hainaut, Liege, Luxembourg, Namur

Arvid
Australia Western Australia, Northern Territory, South Australia, Queensland,

New South Wales, Victoria, Tasmania, Australian Capital Territory

UnwiseOwl
Europe Iceland, Portugal, Ireland, France, Netherlands, Denmark,

United Kingdom, Spain, Italy, Sweden, Belgium, Norway, Germany, Finland, Poland, Switzerland, Austria, Czech Republic, Russia

Danatar
South America Brazil, Chile, Ecuador, Galapagos, Peru, Venezuela,

Suriname, Paraguay, Uruguay, Argentina, Colombia, Guyana, French Guiana, Bolivia

Joannac
North America United States, Canada, Mexico, Honduras, Costa Rica, Virgin Islands,

St. Kitts and Nevis, Grenada, Martinique, Panama, Bahamas, El Salvador, Belize, Bermuda, Cuba, Cayman Islands, Jamaica, Haiti, British Virgin Islands, Trinidad and Tobago, Netherlands Antilles, Antigua and Barbuda, Montserrat, Dominica, St. Lucia, Barbados, Guatemala, Nicaragua, Dominican Republic, Puerto Rico, Anguilla, Guadeloupe, St. Vincent and the Grenadines

Joannac & UnwiseOwl

This table is manually kept up to date, so it may contain typos or just be plain wrong at times. If that seems to be the case, you can also ask the tool itself: try the version and about parameters (the latter will produce text/plain output instead of the usual image/png).

List of upcoming regions

Just to prevent duplicate work...

Region Progress
Europe (Eastern subregions) data complete
Africa data complete
Asia is being prepared

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;ISO;lat-n;lat-s;lng-w;lng-e;
oooooo00oooo
oooo0000000o
ooo00000o000
ooo000000000
oooooooo000o;
;SubRegion1;SUB:ISO;lat-n;lat-s;lng-w;lng-e;
oooooo00oooo
oooo###0000o
ooo####0o000
ooo###000000
oooooooo000o;
;SubRegion2;SUB:ISO;lat-n;lat-s;lng-w;lng-e;
oooooo##oooo
oooo00#####o
ooo000##o000
ooo00###0000
oooooooo000o;
;SubRegion3;SUB:ISO;lat-n;lat-s;lng-w;lng-e;
oooooo00oooo
oooo000000#o
ooo00000o###
ooo0000#####
oooooooo###o;
  • The tags are taken from ISO-3166-1 and -2, when available. If there is no entry, make one up that doesn't collide with the ISO (e.g. I had to invent GX for Galapagos).
  • Subregions are no longer special in any way. Toplevel regions (i.e. continents) only bear their own ISO code, subregions have their parent appended (e.g. EU and DE:EU, respectively). Note that this is the other way round compared to the region= CGI parameter.
  • The two map formats are also equivalent now. The tool converts [o0#] maps to [o0] ones by replacing 0 with o and # with 0. It is just more convenient to chart subregions by copying the parent map and replacing a few 0s, so both are (and will be) supported.
  • 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 matching against that char list, of course.)

Example: current contents of Europe header file

Feedback

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

My agenda

  • ISO3166 matching is done on a first-come-first-serve basis, so depending on the order in the shared memory segment, SA could match South America or South Australia. Easy to fix.
  • Release the code!
  • Encode the image on my own instead of creating an XPM and relying on ImageMagick to do the final conversion. (This is the cause of the main delay now.) libpng's API is horrible, so when I do this, I'll probably switch to GIF.