Sections: !ReMAPTCHA - A free, map-based anti-spam service that enhances !OpenStreetMap | Download | Demo | About | An example of unconnected way error | Another variant of UI design | API for Developers | Notes | Notes | Input data | Project steps | Milestones | Pseudo Code | ReMAPTCHA Components | Figure. 7: ReMAPTCHA database schema. | For developer |

ReMAPTCHA - A free, map-based anti-spam service that enhances OpenStreetMap ^

Download ^

https://git.hsr.ch/git/remaptcha (MIT License]

Demo ^

Webpage: http://remaptcha.herokuapp.com/ >> BETA (for testing purposes)!! (A variation) <<

About ^

ReMAPTCHA is a free service which serves primarily as an anti-spam tool. It prevents that automated programs (bots) register themselves in online systems where they want to leave unwanted weblinks or initiate or collect unsolicited mails. The CAPTCHA does this by showing an image and asking the user a security question which tries to differentiate a human from a computer ("challenge-response authentication").

The secondary use of the ReMAPTCHA is to utilize the power of crowdsourcing. To be able to use online services, like the OSM editor or the OSM Wiki, one need to be registered. When a user answers the security question the ReMAPTCHA not only checks if he is a user, it also helps to correct unconnected ways (http://wiki.openstreetmap.org/wiki/Unconnected_ways) in OpenStreetMap. OpenStreetMap is a collaborative project to create a free map of the globe.

The ReMAPTCHA is a variation of a reCAPTCHA offered and patented by Google. The procedure of the ReMAPTCHA is to display to the user a clipping from the OpenStreetMap and to ask him a question related to a crossing of two ways. Connected ways are importand e.g. for routing an there are many undecided topological situations around crossings in OpenStreetMap because it's a layman's crowdsourcing project. For one connection the ReMAPTCHA knows the answer before hand and uses it as a control mechanism. By confirming or denying the other connection the user helps OpenStreetMap to be enhanced.

This follows Kerckhoff's principle and tries to avoid "security through obscurity".

Image: Draft and mock image of a ReMAPTCHA challenge.

The input is a list of the two unconnected ways (osm ids and their tags). This is a Shapefile periodically updated and provided by Geofabrik GmbH, Karlsruhe (Germany) (with great thanks and appreciation).

An example of unconnected way error ^

Another variant of UI design ^

API for Developers ^

Instruction page of ReMAPTCHA API usage for developers: http://remaptcha.herokuapp.com/usage.

Notes ^

Version of challenge text:

See also WeatherCAPTCHA.

Notes ^

Input data ^

Project steps ^

  1. Installation git.hsr.ch
  2. This Wiki (don't need yet redmine (Wiki, ticketing)
  3. Write pseudo code of image generation algorithm (see below)
  4. Learn Python frameworks (in parallel)
  5. Write code to generate image (based on pseudo code and Python image library)
  6. Filter for errors in the input
  7. test page with local http server (usual HTML code) with one webservice

  1. implement API (similar to ReCAPTCHA)
  2. implement and test page with external homepage (test environment) based on API (Javascript)
  3. release service on geowebforum (production)
  4. implement template code for other consumer pages
  5. implement service for giswiki.hsr.ch (based on MediaWiki/PHP)
  6. revise template code for other consumer pages (MediaWiki)
  7. to be continued...

Milestones ^

Pseudo Code ^

Pseudo code of CAPTCHA:

# Seek problem (way-id, highway-type, (other tags?), node-id, node-coordinates, other-way-id, othery-highway-type)
while not pass
  ...
  call image generation algorithm
...

Pseudo code of image generation algorithm:

image generation procedure:
  # Constants:
  LABEL_SIZE = 10 pixels
  IMAGE_SIZE = 256 x 144 pixels

  #the OSM API can be found at http://wiki.openstreetmap.org/wiki/PythonOsmApi
  # use the OSM API to get the list of point for 2 ways:
  way1 = genway(id_way1)
  way2 = genway(id_way2)
  # convert from geo coordinate to pixel value (can be found @ http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Lon..2Flat._to_tile_numbers_2 , filter out point that are out of the bounding box

  way1 = filter(way1)
  way2 = filter(way2)
  # there are 3 cases in filter way, there are way which have 0 point inside the BB, 1 point or > 1 point.
  # If there is 0 point, find 2 intersect point of the way with the BB. I used a binary search for finding the intersect point.
  # If there is 1 point, get 1 more intersect point.
  # If there are >= 2 points, all is well!

  get OSM map tiles # @ 'a.tile.openstreetmap.org/{}/{}/{}.png' at most 4 tiles are needed.  
  call the routing procedure
  place car and flag
return image

def routing procedure:
   determine the point in question
   find out the closest point to the point in question
   select a point 1 or 2 point away from the point in qns. #this can be improved. Alternative: Choose 2 points that are farthest from each other. 
   call point label procedure
   # currently 6 positions around the point P are examined, the one that has the biggest minimum distance to other points are selected.
   1....2....3
   .....P.....
   4....5....6
return

def point label procedure
   generate label # 3 to 4 characters or numbers
   distort label
return

Future enhancement:

Some note:

1500 maptchas (size 15mb) need about 4000 tiles, equal to about 20mb of raw map data.

Issues:

1603,4689789,29809938,service,13,5,"Not connected - Distance: 5m Way-ID: 4689788",POINT (-1.0864603 52.1495519)

1604,4689789,29809937,service,13,5,"Not connected - Distance: 5m Way-ID: 4689788",POINT (-1.086388 52.1495598)

ReMAPTCHA Components ^

Figure. 7: ReMAPTCHA database schema. ^

For developer ^


Copyright © GeometaLab HSR · Map data © OpenStreetMap contributors (ODbL 1.0) and Geofabrik · Map tiles © CC BY-SA 2.0 · ReMAPTCHA patent in preparation