The support forum is temporarily read-only. For urgent requests, please email contact[at]psyberia.net

UK Ordnance Survey OpenData Topo Map

It's all about maps...
Post Reply
RambleJoy

UK Ordnance Survey OpenData Topo Map

Post by RambleJoy »

This might help someone wanting to use OS maps of Great Britain, to some extent.

The attached AQX file will install what is directly available for free as a custom map (or, at least, it worked for me: no doubt it could be refined, hopefully there's no glaring error).

To be clear, this is the "Outdoor" styled (vector?) map released by Ordnance Survey as free-to-access-and-reuse OpenData, and served as raster tiles through their own API.

Although it has topographical detail, and goes down to 1:10K for urban area detail too, this "Outdoor" map is not the same as the iconic 1:50K Landranger or 1:25K Explorer "Leisure" walking maps. Those are considered "Premium Data" by the OS. The most important practical difference is that those show footpaths, bridleways etc., whereas the OpenData map does not.

In conjunction with OSM layers for path information and the local authority rights of way data you can import as placemarks from http://www.rowmaps.com the OpenData map can still be useful in lots of ways, and in its own right; so is worth having as an option.

To install it as a custom map in AlpineQuest, you first have to obtain a free OpenData API key from https://osdatahub.os.uk -- this is available to private individuals (unlike Premium keys) and gives you unlimited use and caching, subject to a standard rate limit of 600 tile transactions per minute. The process is straightforward:
  1. Create an account
  2. Create a project (the name doesn't matter)
  3. Add the Maps API to that project
  4. Copy the resulting API Key (not the API Secret) to use below
Next simply edit the AQX file using a text editor (it's an XML file) to insert your shiny new key in the obvious place, where is says REPLACE_THIS_TEXT_WITH_YOUR_OWN_KEY .

By way of preview, this is the code in the file:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<aqx version="9">

	<name>GB OS OpenData Maps</name>
	<description>Ordnance Survey Data © Crown Copyright</description>
	<!--This AQX file needs to go in the /Android/data/psyberia.alpinequest.full/files/datastore/maps/ folder-->
	
	<param name="my-api-key">REPLACE_THIS_TEXT_WITH_YOUR_OWN_KEY</param>
	<!--A *free* personal API key to use here can be obtained from https://osdatahub.os.uk/plans -->

	<source id="OSOD" type="topo">
		<name>OS OpenData Outdoor Style</name>
		<region>EURO</region>
		<copyright>Ordnance Survey Crown Copyright</copyright>
		<zoom-levels z="7,8,9,10,11,12,13,14,15,16">
			<!--In the EPSG:3857 web mercator tile matrix set 7 is the lowest available, representing 1:4,622,324 scale, whilst levels above 16, which is 1:9,028 scale, count as Premium Data-->
			<ignore-errors>404</ignore-errors>
			<update-delay>None</update-delay>
			<servers>
				<server><![CDATA[https://api.os.uk/maps/raster/v1/zxy/Outdoor_3857/{$z}/{$x}/{$y}.png?key={$param:my-api-key}]]></server>
			</servers>
		</zoom-levels>
	</source>
</aqx>
Finally, put the file somewhere that AlpineQuest can read it eg. your Downloads folder, and select it for installation using the same procedure as a file-based map. It will be copied to the correct application folder and is then no longer needed.
Attachments
OSOPENDATAMAPS.aqx
(1.07 KiB) Downloaded 9414 times
Psyberia-Support
Site Admin
Posts: 6408
Joined: Wed Apr 14, 2010 9:41 pm

Re: UK Ordnance Survey OpenData Topo Map

Post by Psyberia-Support »

Hi,
Thank you for this great tutorial.

I did use it and setup an access to the OS OpenData maps that I added in the community maps list. So now you can add those maps in a few taps.
The community maps list version use a common key, that may reach quota, but you can still use the tutorial above to get an access with your own key.
Do you like AlpineQuest ? Leave a small comment on Google Play !
MrSpaghetti

Re: UK Ordnance Survey OpenData Topo Map

Post by MrSpaghetti »

Hi! This is great, thanks. Do you know of an alternative for Scotland? Seems to only cover England/Wales.
RambleJoy

Re: UK Ordnance Survey OpenData Topo Map

Post by RambleJoy »

It definitely covers Scotland.

One problem I am having, however, is that AlpineQuest keeps setting the API key to null (according to the log).

To fix it, I have to:
  1. Quit AQ
  2. Edit the USR.OSOPENDATAMAPS.AQX file in ///_Android_data/psyberia.alpinequest.full/files/datastore/maps/ to change the key by one letter
  3. Launch AQ
  4. Quit AQ
  5. Edit the USR.OSOPENDATAMAPS.AQX file in ///_Android_data/psyberia.alpinequest.full/files/datastore/maps/ to change the key back to the correct one
  6. Launch AQ
This is on Android 12 using AQ v.2.3.1c

I think it may have started with that version, but can't be sure. It may also be linked to me having "Use only local storage" set most of the time: again, I can't be sure as haven't tested extensively. I may try just moving the API key to the URL rather than setting it as a parameter to see if that solves the problem.


Anyway, the attached may be of some help for Scottish excursions. It's a collection of .ldk placemark files I imported from public sources, but which are a bit of a pain to collect together so may save you some time and effort: mountain peaks, national parks and "Great Trails," which are the more informal Scottish version of the National Trails long distance paths in England & Wales.
Attachments
Scotland_Placemarks.zip
Collected public data
(940.45 KiB) Downloaded 9329 times
RambleJoy

Re: UK Ordnance Survey OpenData Topo Map

Post by RambleJoy »

MrSpaghetti wrote: Mon May 23, 2022 4:36 pm Seems to only cover England/Wales.
Realised you might have meant rowmaps rather than the OS mapping.

That, indeed, doesn't cover Scotland, because Scottish Rights of Way are legally both simpler and more complicated...

There's no easy download for footpaths, afaik, (hence the value of OS "premium" data...) but these sites may help:

https://www.nature.scot/enjoying-outdoo ... rights-way

https://scotways.com/crow/

http://www.heritagepaths.co.uk/project.php

https://data.spatialhub.scot/dataset/core_paths-is (Annoyingly just out of reach unless you have the right licence.)



For England, you can, additionally, get Open Data kml/kmz files for:

National Trails

National Parks

Country Parks

Areas of Outstanding Natural Beauty

Transport for London Cycle Ways
Psyberia-Support
Site Admin
Posts: 6408
Joined: Wed Apr 14, 2010 9:41 pm

Re: UK Ordnance Survey OpenData Topo Map

Post by Psyberia-Support »

RambleJoy,
Thank you for sharing all this information.

Concerning your problem, is it possible that you use this same parameter name "my-api-key" for multiple (test?) AQX files?
Parameters are shared among all installed files, so be sure to use different parameter names in your different AQX files so they don't overwrite each other.
To check this, search if you have multiple lines like this one in your logs: updating param 'my-api-key' to 'XXX' (old: YYY)
Do you like AlpineQuest ? Leave a small comment on Google Play !
RambleJoy

Re: UK Ordnance Survey OpenData Topo Map

Post by RambleJoy »

Psyberia-Support wrote: Thu May 26, 2022 1:28 am RambleJoy,
Thank you for sharing all this information.

Concerning your problem, is it possible that you use this same parameter name "my-api-key" for multiple (test?) AQX files?
Parameters are shared among all installed files, so be sure to use different parameter names in your different AQX files so they don't overwrite each other.
To check this, search if you have multiple lines like this one in your logs: updating param 'my-api-key' to 'XXX' (old: YYY)
Yes, THANK YOU, that was exactly the problem!
I didn't realise named parameters were global, and I'd used the same name for a Bing key.
I actually fixed it by commenting out the parameter line and inserting the key directly into the server URL instead.
Given that there's only one server line, I presume there's no disadvantage in doing that?

(NB: It's unlikely anybody else will be affected by this edge case.)


One more link to share for cycle tourists.

GPX files are available for some well-thought-out long-distance routes in both England and Scotland from Cycling UK.

(As can be seen on the site, we have the European Regional Development Fund to thank for that, from before the world went mad. But cycling remains, to bring us smiles via fantastic French software!!! :D )
Psyberia-Support
Site Admin
Posts: 6408
Joined: Wed Apr 14, 2010 9:41 pm

Re: UK Ordnance Survey OpenData Topo Map

Post by Psyberia-Support »

Given that there's only one server line, I presume there's no disadvantage in doing that?
Absolutely not, just useful when you use a same key on multiple locations.
I didn't realise named parameters were global
You couldn't, I've just updated the online help now on this topic, because it wasn't mentioned anywhere... The app maintain an up-to-date pool of global parameters that can be used in any files, this is why they have been made common.

And thank you again for your support!
Do you like AlpineQuest ? Leave a small comment on Google Play !
RambleJoy

Re: UK Ordnance Survey OpenData Topo Map

Post by RambleJoy »

That's very useful to know. Could be handy.

We're all just trying to make the world a better place in small ways 8-)

Although, making AQ is quite a big way! :idea:
RambleJoy

Re: UK Ordnance Survey OpenData Topo Map

Post by RambleJoy »

Oooh!
A really good extra link here for walks in Scotland:

https://www.walkhighlands.co.uk

The maps are well designed so that potential walks are very easy to locate, and then they all have GPX and KMZ files to download for free.

Nice!
Post Reply