Elevation Correction

by pkan

Downloads: 64,344 (30) • Reviews: 11

Version:

1.9

Updated:

Nov 29, 2017

Getting elevation data from UK Ordnance Survey maps

Getting elevation data from UK Ordnance Survey maps

Postby rogerpgvg » Tue Feb 18, 2014 12:25 pm

Ordnance Survey, the national mapping agency in the UK, provides open source data that contain elevation. I recently managed to find a way of using the OS Landform Panorama data in the Elevation Correction plugin. The OS panoramas should be more accurate than the SRTM data, because they have a 50m x 50m resolution, whereas SRTM has 90m x 90m. In my experience, the elevation is also less affected by high buildings and forests. It took me quite a while to figure out how to get the OS elevation data, so I thought I’d share what I did.
_______________________________________________________________
Download .hgt files from:
http://members.uktrainsim.com/filelib-d ... 10,cls=875
You need to register to be able to download. Downloading is very slow and you may have to wait in a queue before you can start the download. You can speed it up by becoming a premium member.

You get .rar files that need to be unzipped. I used Bitzipper to do this:
http://www.bitzipper.com/

Put all .hgt files into a single folder (though this folder may have subfolders with the .hgt files).

In SportTracks, make sure you have installed both the Elevation Correction and GDAL plugins.

In ST, go to “Settings”, “Plugins”, “Elevation Correction”. Click “Add folder”. Select the folder with .hgt files and click “OK”.

Restart ST. Next, when you go to the Elevation Correction plugin Activity Detail page, you can see the OS elevation data.
_______________________________________________________________

Downloading the .hgt files from the train simulator website is painfully slow. If someone knows a good way to make the files more easily accessible, let me know and I’ll try to do that. The OS Landform Panoramas were produced in the 70s and 80s. I guess elevation doesn’t change so quickly, but OS has newer elevation data called OS Terrain: https://www.ordnancesurvey.co.uk/openda ... ducts.html. This comes as .asc data files. Unfortunately, I can’t find a way to convert them into a format that the Elevation Correction plugin can read. If anyone has any idea how to do this, please let me know.
rogerpgvg
 
Posts: 100
Joined: Mon May 27, 2013 12:14 pm

Re: Getting elevation data from UK Ordnance Survey maps

Postby pkan » Sat Feb 22, 2014 4:07 pm

Actually, it turns out that you don't have to do any conversion at all to use the OS Terrain 50 dataset with the Elevation Correction plugin. GDAL, and hence the Elevation Correction plugin, can read the .asc + .prj (Arc/Info ASCII Grid + projection) files. The reason that *.asc is not included in the "All DEM files" file filter for "Add DEM" is that it wasn't clear from the summary of GDAL supported file formats that I looked at that .asc is a standard suffix for Arc/Info ASCII Grid. However, individual .asc files (with corresponding .prj files) can be added by switching to "All files (*.*)". And for folder DEMs, the plugin will try to load all files and will discover that the .asc files are valid ones.

This means that you can use the OS Terrain 50 dataset with the Elevation Correction plugin as follows:
  • Download the OS Terrain 50 data in ASCII Grid and GML (Grid) format from https://www.ordnancesurvey.co.uk/opendatadownload/products.html. It is delivered as a 152 MB zip file.
  • Unzip the downloaded file.
  • Unzip all the individual map tiles that you are interested in. They are individually zipped into files with names like data/tq/tq01_OST50GRID_20130611.zip. To figure out which map tiles to unzip, you can use the OS national grid map: http://www.ordnancesurvey.co.uk/docs/maps/national-grid-map.pdf
  • Put all .asc and .prj files into a single folder. This folder may have subfolders with the .asc and.prj files. For instance, keeping the original folder structure and just unzipping the files in place is fine.
  • In SportTracks, make sure you have installed both the Elevation Correction and GDAL plugins.
  • In ST, go to “Settings”, “Plugins”, “Elevation Correction”. Click “Add folder”. Select the folder with the .asc and .prj files and click “OK”.
  • The plugin will immediately start scanning the folder and report the number of individual map tiles found, which should equal the number of tiles that you unzipped.
  • Make sure that the folder DEM has the right priority. Typically you would want to put it first on the list of DEMs, before the SRTM ones, so that it is used when applying elevation correction for activities in the UK.
  • Note that you may rename the folder DEM if you want to.
  • The OS Terrain 50 data is now available for corrections, graphs in the Elevation Correction plugin Activity Detail page, and point-and-click using the Elevation pointer mode in the map display (click Explore and change to Elevation).
  • If you unzip more map tiles later, the plugin will pick this up automatically the next time ST is restarted.
pkan
Donated!
Donated!
 
Posts: 145
Joined: Fri May 12, 2006 2:26 pm
Location: Sweden

Re: Getting elevation data from UK Ordnance Survey maps

Postby rogerpgvg » Fri Feb 28, 2014 8:55 am

Thanks a lot, great to have the OS Terrain elevation. What could cause the unhandled exception error “longitude or latitude exceeded limits”? Once I get this error message, ST starts showing other error messages. It must have to do with the OS Terrain files, because without them, the plugin works fine. I wonder whether it might be a longitude or latitude error in one of the OS files, but I don't know whether the error message tells me which file it is.
Attachments
OSTerrainError.zip
(5.45 KiB) Downloaded 247 times
rogerpgvg
 
Posts: 100
Joined: Mon May 27, 2013 12:14 pm

Re: Getting elevation data from UK Ordnance Survey maps

Postby pkan » Sat Mar 01, 2014 8:59 am

The OS Terrain elevation data is in projected British National Grid coordinates, and the exception occurs when this projection is applied to GPS points with a longitude more than 90 degrees away from its central meridian 2°W, i.e., outside 92°W to 88°E. In your case this seems to happen when the plugin encounters an activity outside this range while checking if any elevation data needs to be downloaded. As a temporary workaround you can try unchecking "Download elevation data for all activities" on the plugin settings page. You will have to do this rather quickly after starting SportTracks and then immediately quit the application.

I've fixed the problem in my code, and the fix will be included in the new version of the plugin that I'm about to release for other reasons. The new version is done, and only needs a little bit of additional testing before being released.
pkan
Donated!
Donated!
 
Posts: 145
Joined: Fri May 12, 2006 2:26 pm
Location: Sweden

Re: Getting elevation data from UK Ordnance Survey maps

Postby rogerpgvg » Tue Mar 11, 2014 5:56 am

That solves it, thanks. I have one other problem. The plugin seems to get confused when I have both the OS Terrain and OS Landform Panorama elevations. See figure for an example. I have ranked OS Terrain (red) highest, but it mostly uses OS Landform (green) for the correction, except at 3-6 and 30-33 mins, where it uses OS Terrain. Is there any way around this?
Attachments
2014, Elevation Correction.png
2014, Elevation Correction.png (42.63 KiB) Viewed 8759 times
rogerpgvg
 
Posts: 100
Joined: Mon May 27, 2013 12:14 pm

Re: Getting elevation data from UK Ordnance Survey maps

Postby pkan » Fri Mar 21, 2014 3:31 pm

rogerpgvg wrote:The plugin seems to get confused when I have both the OS Terrain and OS Landform Panorama elevations.

This might be related to the edges of individual tiles being handled a bit differently in OS Terrain compared to most other datasets divided into tiles (SRTM, DTED, ...), with no overlapping values. In version 1.7 of the plugin this causes points right at the edges to "fall between the cracks" and be corrected using the next DEM in the priority list. In version 1.8, which has now been released, I've added a fix for this problem. Hopefully this helps.

One other thing: I've improved DEM folder scanning speeds in version 1.8, but scanning the entire OS Terrain 50 dataset, consisting of 2858 tiles, still takes about one minute on my laptop, and elevation correction can't performed until the scan is finished. For this reason, it might be a good idea to install only the parts of the OS Terrain data that you care about, rather than the whole dataset.
pkan
Donated!
Donated!
 
Posts: 145
Joined: Fri May 12, 2006 2:26 pm
Location: Sweden

Re: Getting elevation data from UK Ordnance Survey maps

Postby rogerpgvg » Wed Apr 16, 2014 10:08 am

Just to say thank you for the new version. Everything works perfectly now!
rogerpgvg
 
Posts: 100
Joined: Mon May 27, 2013 12:14 pm


Return to Elevation Correction

Who is online

Users browsing this forum: No registered users and 1 guest