Sections: !ReMAPTCHA - A free, map-based anti-spam service that enhances !OpenStreetMap | Intro and Status | About | An example of unconnected way error | Another variant of UI design | Resources (OUTDATED!) | NOTES | Webresources | 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 ^

>> Note: This was a small research project from the Geometa Lab HSR which was closed around 2014. <<

Intro and Status ^

ReMAPTCHA was a nifty feasability study from Prof. Stefan Keller's and his Geometa Lab HSR which was closed around 2014. The code is available under an MIT license on request, since the repo has gone too. The algorithm is free and not patentable since it was published 2014:

Paper publication: KELLER, S. (2014). ReMAPTCHA: A Map-based Anti-Spam Method that Helps to Correct OpenStreetMap. GI_Forum. (APA style). Download PDF (accessed 2018-11-02).

The reason why this spatially inspired variant of a CAPTCHA was never been put in place by Geometa Lab as a service is manyfold:

The interesting - rather ironic - thing to note is, that the Google CATPCHA "I am not a robot!", which is still in broad use, very often falls back to some crowdsourcing reCAPTCHA. And those reCAPTCHAs (detecting about 9 house numbers, traffic signals or shop entries) are as demanding as any other CAPTCHA - in fact more annoying than ReMAPTCHA, and surely less privacy preserving.

Image: Copyright © GeometaLab HSR · Map data © OpenStreetMap contributors (ODbL 1.0) and Geofabrik · Map tiles © CC BY-SA 2.0

About ^

ReMAPTCHA is (was) a free service (feasability study) 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 ( 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 ^

Resources (OUTDATED!) ^


Version of challenge text:

See also WeatherCAPTCHA.

Webresources ^

Input data ^

Project steps ^

  1. Installation
  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 (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
  # 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 @ , 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 # @ '{}/{}/{}.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.

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

Future enhancement:

Some note:

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


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 ^