keep-right logodata consistency checks for OSM

Interfacing with KeepRight

You may use KeepRight's results in a number of ways:

exporting GPX waypoints

Purpose
Exporting a section of the map into a GPX-styled list of waypoints for use with GPS units

URL format
https://keepright.at/export.php?format=gpx&ch=20,30,311,312&left=-82.39&bottom=30&right=-82.1&top=30.269
You can specify a list of error types you want to have in the file as well as a bounding box on the map. This export will return up to 10000 waypoints.

There is a link on the lower left corner of the map-page pointing to the GPX service that always includes the current error type selection and view from the map.

exporting new errors as RSS feed

Purpose
Watching a section of the map for newly found errors

URL format
https://keepright.at/export.php?format=rss&ch=20,30,311,312&left=-82.39&bottom=30&right=-82.1&top=30.269 The URL format is the same as for GPX exports, just the format parameter is different. The RSS feed will include error entries that were first found within the last three weeks.

There is a link on the lower left corner of the map-page pointing to the RSS service that always includes the current error type selection and view from the map.

getting the whole dump-file

Purpose
Doing something completely different with 25 millions of errors...

URL format
https://keepright.at/keepright_errors.txt.bz2 This tab-separated file contains all errors currently open for the whole planet (currently >500MB). It is being updated daily.

Table layout


loading the errors table

This is the schema definition for use with MySQL databases:
CREATE TABLE IF NOT EXISTS `keepright_errors` (
  `schema` varchar(6) NOT NULL default '',
  `error_id` int(11) NOT NULL,
  `error_type` int(11) NOT NULL,
  `error_name` varchar(100) NOT NULL,
  `object_type` enum('node','way','relation') NOT NULL,
  `object_id` bigint(64) NOT NULL,
  `state` enum('new','reopened','ignore_temporarily','ignore') NOT NULL,
  `first_occurrence` datetime NOT NULL,
  `last_checked` datetime NOT NULL,
  `object_timestamp` datetime NOT NULL,
  `user_name` text NOT NULL,
  `lat` int(11) NOT NULL,
  `lon` int(11) NOT NULL,
  `comment` text,
  `comment_timestamp` datetime,
  `msgid` text,
  `txt1` text,
  `txt2` text,
  `txt3` text,
  `txt4` text,
  `txt5` text
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
mysql --local-infile --password --user=root --execute "LOAD DATA LOCAL INFILE 'keepright_errors.txt' INTO TABLE keepright_errors CHARACTER SET utf8 IGNORE 1 LINES;" osm_EU 

Please note that schema is a reserved word in MySQL, so you always have to quote it like this: `schema`

There are two primary keys in this table: a natural one and an artificial one:
The natural primary key consists of error_type, object_type, object_id, lat, lon. That means one type of error may be found on multiple spots belonging to one single object (eg. self-intersections of ways).
The artificial primary key consists of schema and error_id. It is used just for simplicity of referencing individual error instances and it is completely redundant.



querying node counts

As a waste-product the scripts create a file that contains the numer of nodes per square degree found in the planet file. Resolution is 0.1 degrees. You may download the file here: https://keepright.at/nodecount.txt.bz2
This dump file can be useful for statistics if you want to calculate an `errors per node` measure