OS Locator

From OpenStreetMap Wiki
Jump to: navigation, search
OS Locator data displayed in Potlatch2 using ITO World's OSM and OSL differences tileset tool

OS Locator (OSL) is one of the datasets which were released in 2010 as part of the Ordnance Survey Opendata releases in the UK, but it is now being discontinued (see below). OS Locator is a file with a list of road names and positions for the UK. Although the file does not give road geometry, it does give a rough location for every street. This is good enough to use as check list / comparison dataset, in tools for Quality Assurance of OpenStreetMap and for measuring completeness.

Discontinued

In March 2015 OS announced that the OS Locator product will be discontinued because it is replaced by OS Open Names. This new product "combines the best elements of the 1:50 000 Scale Gazetteer, OS Locator and Code-Point Open"

This means the following tools will most likely start to go out-of-date (in terms of OS data, but probably still up-to-date with OpenStreetMap changes) Unless/until they are migrated to use OS Open Names

Comparison tools

There are several tools for comparing OS Locator streets data with OpenStreetMap.

  • OSM and OSL differences tileset - From ITOworld, this is available for use as a background layer with editors. Follow the link for instructions on how to use an editor with these tiles.
  • OS Locator Musical Chairs ([2]) - A browseable OpenLayers interface to the results of a smart fuzzy-matching musical chairs algorithm, highlighting disagreements between OS Locator and OSM and Locator street names that are altogether missing from OSM.
  • oslVosm - A php script which you can run on your own area.

Interpreting the differences

You should never just change street names in OpenStreetMap to match OS Locator names. That's really not the idea at all! By doing this, you could be using information with errors and overwriting information which has been properly surveyed by people out on-the-ground. Even if the surveyed OSM data looks like an error, you should assume that data is correct unless you can get there on the ground to check.

It is also quite widely regarded as unhelpful to copy streetnames from OS Locator for places you have never visited. In the UK we are building strong local communities of mappers, and therefore armchair mapping techniques tend to be frowned upon. However some people are doing this in some areas. If you do this you should definitely use the source tag (and probably on the elements themselves) :

source:name=OS_OpenData_Locator

If this tag is used on elements (as opposed to changesets) then mappers should be bold and remove the source tag or replace it, when they have surveyed and verified the street name.

Discussion: Vclaw's diary, chriscf’s diary,discussion on talk-gb , and no doubt many other places (TODO: link here)


TODO: More general notes on interpreting the differences and corrective actions to take with editors.

Create GPX file of OSL data

Useful for:

  • JOSM (can be opened as a new layer)
  • Google Earth
  • oslVosm (automatic OSL and OSM matching script)

Prerequisites

This method has been tested using Ubuntu 9.04. It requires the following:

  • grep (standard in Linux, and also in cygwin)
  • gpsbabel (in the standard repositories)
  • A spreadsheet program. OpenOffice.org Spreadsheet is fine.

Get OS Locator data

Process OS Locator data for your area

  • First, extract from the data file the items which are in our area. In this case, Bath and North East Somerset. Save this to a text file called BANES.txt.
grep "Bath and North East Somerset" OS_Locator2010_1_Open.txt > BANES.txt
  • BANES.txt now contains all the streets within the BANES area, one per line with corresponding OSGB Grid References for their locations. Each field within a line is separated by colon.

Convert Data into Useful GPX file

  • Open the file BANES.txt using Excel or OpenOffice Spreadsheet, making sure to choose the ":" as the field delimiter.
  • In cell Q1, add the following:
=CONCATENATE(LEFT(O1,2), " ", MOD(C1,100000)," ",MOD(D1,100000))
  • Copy this down for the rest of the rows. This provides a 10 figure grid reference, which will be fed to gpsbabel and converted into lat/lon pairs. To do this, first save or export the spreadsheet as a tab-delimited file, BANES.tab.
  • Next, copy and past the following gpsbabel stylesheet into your favourite text editor, and save as OSGB.style.
# Format: Import (Excel-modified) OS Locator street name centres
# Author: D Dixon
#   Date: 8 April 2010
#

DESCRIPTION  Import (Excel-modified) OS Locator street name centres
EXTENSION    txt

#
# FILE LAYOUT DEFINITIIONS:
#
FIELD_DELIMITER TAB
RECORD_DELIMITER NEWLINE
BADCHARS 
DATUM OSGB36

#
# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE:


IFIELD DESCRIPTION, "", "%s" # Street name
IFIELD SHORTNAME, "", "%s" # Street ref 
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD IGNORE,"","%s"
IFIELD MAP_EN_BNG,"","%s %5d %5d"   # OS Grid reference
  • Now, run the following command to process BANES.tab and convert it into a GPX file.
gpsbabel -w -i xcsv,style="OSGB.style" -f "BANES.tab" -o gpx -F "BANES.gpx"

Cut down data to Bath City area only

Currently, BANES.gpx has all the roads in the Bath and North East Somerset area. I only care about the roads actually within Bath, so we need to cut down the GPX file and extract only those roads which are within the city. This is done using the polygon filter in gpsbabel.

  • Using http://www.openstreetmap.org/, determine the appropriate bounding box for your desired area.
  • Using this data, create a file called BATH.bb, and insert the bounding box in the following way:
51.4249453       -2.4529905999999997
51.337054699999996       -2.4529905999999997
51.337054699999996       -2.2772094
51.4249453      -2.2772094
51.4249453       -2.4529905999999997
  • Those are the corner positions in lat/lon for the bounding box of Bath. Notice that the last line is the same as the first - this is required to close the box. Now, run the following to extract only the roads within Bath from BANES.gpx.
gpsbabel -w -i gpx -f BANES.gpx -x polygon,file=BATH.bb -o gpx -F Bath_Streets.gpx

You now have a GPX file which can be loaded into JOSM or Google Earth.