View Single Post
  #3  
Old February 16th 10, 09:57 PM posted to uk.rec.gps
Einar Ryeng
external usenet poster
 
Posts: 5
Default British Canals & locks

andrew writes:
f825_633 wrote:

I'm after a waypoint list of locks etc on the UK canal system,
specifically the Oxford& Grand Union,

I've googled for ages and not found such a thing - hard to image some
sort of list doest exist.


It exists on OSM but getting it out of the database is beyond me, its
probably availabe as a shapefile too.


The easiest way to get this out of OSM is probably through OSM XAPI,
which allows you to write simple queries directly in the URL. Details
can be found on:

http://wiki.openstreetmap.org/index.php/Osmxapi

....though I have a feeling that it might not be an easy read for
people not familiar with the OpenStreetMap project. :-/ In any case it
requires some computer literacy to use it.

In brief, the way to use it is:

1) The base URL to XAPI is
http://xapi.openstreetmap.org/api/0.6/

2) The rest of the URL is the query. OSM data consist primarily of
"nodes" and "ways", and most locks are probably nodes. Thus, for
any query for nodes we want a URL starting with:

http://xapi.openstreetmap.org/api/0.6/node

3) OSM covers the entire world. To restrict it to UK, add a bounding
box (bbox) with coordinates bbox=left,bottom,right,top in decimal
degrees, so the URL becomes e.g.:

http://xapi.openstreetmap.org/api/0.6/node[bbox=-8,50,2,59]

This URL probably works, and would give you a huge (really!!)
(Please don't try, there are better ways to download that amount of
data) file of all nodes OSM has in the UK and parts of France and
Ireland. However, most of those nodes will not be of any use, and
hardly any of them are related to canals at all. You need to
specify which types of nodes you want.

4) Elements in OSM are tagged with key=value pairs to say which
feature it is. Locks seems to be tagged with waterway=lock_gate

http://xapi.openstreetmap.org/api/0.6/node[bbox=-8,50,2,59][waterway=lock_gate]

which is the URL you want to download. This will give you a file
named data.osm which is in OpenStreetMap's xml format.

5) You might be interested in more elements than just locks, take a
look at http://wiki.openstreetmap.org/wiki/M...tures#Waterway
for a list of tags that may be useful to you. The XAPI queries does
not allow matching "feature1 OR feature2", so every type of feature
you want must be downloaded in a separate query. For a query that
matches any node with a waterway tag, use:

http://xapi.openstreetmap.org/api/0.6/node[bbox=-8,50,2,59][waterway=*]

6) To convert the downloaded .osm file(s) to .gpx, you need a command
line program named gpsbabel which converts between various types of
geospatioal file formats. The specific command (well, on Linux in
any case) for converting the downloaded file to GPX is:

gpsbabel -i osm -f data.osm -o gpx -F data.gpx

Hope this helps. Beware, there may be more steps to this that I
haven't thought of, particularly regarding the resulting gpx
file. I've never loaded gpx files created this way onto my GPS so I
have no idea of the details of it.


Cheers,

--
Einar Ryeng
 

Mortgages - Home Insurance - Life Insurance - WoW Gold - Chants