Skip to content

Commit

Permalink
Merge pull request #25 from and-marsh/pr-add-main-uk-geoid
Browse files Browse the repository at this point in the history
Add uk_os_OSGM15_GB.tif geoid file for ODN height, UK
  • Loading branch information
rouault authored Jun 18, 2020
2 parents 0aecf59 + 77fa91c commit 0bbb5d1
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 0 deletions.
1 change: 1 addition & 0 deletions copyright_and_licenses.csv
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ sk_gku_JTSK03_to_JTSK.tif,Copyright 2013 - GKU Slovakia,CC-BY-4.0
sk_gku_Slovakia_ETRS89h_to_Baltic1957.tif,Copyright 2005 - GKU Slovakia,CC-BY-4.0
sk_gku_Slovakia_ETRS89h_to_EVRF2007.tif,Copyright 2014 - GKU Slovakia,CC-BY-4.0
uk_os_OSGM15_Belfast.tif,Ordnance Survey UK,BSD-2-Clause
uk_os_OSGM15_GB.tif,Ordnance Survey UK,BSD-2-Clause
uk_os_OSGM15_Malin.tif,Ordnance Survey UK,BSD-2-Clause
uk_os_OSTN15_NTv2_OSGBtoETRS.tif,Ordnance Survey UK,BSD-2-Clause
uk_os_README.txt,Disclaimed,Public domain
Expand Down
1 change: 1 addition & 0 deletions travis/expected_main.lst
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ sk_gku_README.txt
sk_gku_Slovakia_ETRS89h_to_Baltic1957.tif
sk_gku_Slovakia_ETRS89h_to_EVRF2007.tif
uk_os_OSGM15_Belfast.tif
uk_os_OSGM15_GB.tif
uk_os_OSGM15_Malin.tif
uk_os_OSTN15_NTv2_OSGBtoETRS.tif
uk_os_README.txt
Expand Down
56 changes: 56 additions & 0 deletions uk_os/OSGM15_GB.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/sh

if [ "$#" -lt 2 ]; then
echo "Usage: $(basename $0) source_file.txt output_file.tif"
exit 1
fi

SOURCE_FILE=$1
TARGET_FILE=$2

ETRS89_BRITISH_NAT_GRID='PROJCS["ETRS89 / British National Grid",
GEOGCS["ETRS89",
DATUM["European_Terrestrial_Reference_System_1989",
SPHEROID["GRS 1980",6378137,298.257222101,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6258"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4258"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",49],
PARAMETER["central_meridian",-2],
PARAMETER["scale_factor",0.9996012717],
PARAMETER["false_easting",400000],
PARAMETER["false_northing",-100000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["Easting",EAST],
AXIS["Northing",NORTH]]
'
RES_LAT=0.008983192446931791 # RES_NORTHING/(PI*GRS80_RAD/180)
RES_LONG=0.015839681746927323 # RES_LAT/cos(MID_AREA_LAT)
# RMSE = 0.0007570669375634179m
# MAX_ERROR = 0.0019630308326981094m

NO_DATA_VALUE="-32768"

tail -n +2 ${SOURCE_FILE} | awk 'BEGIN {FS=","; OFS=" "} {print $2, $3, $6}' > osgm15_temp


gdalwarp -r bilinear -dstnodata ${NO_DATA_VALUE} -tr ${RES_LONG} ${RES_LAT} -s_srs "${ETRS89_BRITISH_NAT_GRID}" -t_srs EPSG:4937 osgm15_temp osgm15_temp.tif
gdal_translate -mo "AREA_OR_POINT=Point" osgm15_temp.tif ${TARGET_FILE}

rm ./osgm15_temp ./osgm15_temp.tif

# Add metadata with grid_tools of PROJ-data repository
# ./grid_tools/vertoffset_grid_to_gtiff.py \
# --description "ETRS89 (EPSG:4937) to ODN height (EPSG:5701). Converted from OSTN15_OSGM15_DataFile.txt" \
# --type "GEOGRAPHIC_TO_VERTICAL" \
# --copyright "Derived from work by Ordnance Survey. The 2-Clause BSD License https://opensource.org/licenses/bsd-license.php" \
# --area-of-use "Great Britain mainland onshore" \
# --source-crs "EPSG:4937" \
# --target-crs "EPSG:5701" \
# ${TARGET_FILE} uk_os_OSGM15_GB.tif
Binary file added uk_os/uk_os_OSGM15_GB.tif
Binary file not shown.
17 changes: 17 additions & 0 deletions uk_os/uk_os_README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,23 @@ The Belfast datum is used in the Northern Ireland.

* uk_os_OSGM15_Belfast.tif

### United Kingdom: OSGM15 height, ODN height -> ETRS89 ellipsoidal heights

*Source*: [Ordnance Survey](https://www.ordnancesurvey.co.uk/business-and-government/help-and-support/navigation-technology/os-net/formats-for-developers.html)
*Format*: GeoTIFF converted by `OSGM15_GB.sh`
*License*: [The 2-Clause BSD License](https://opensource.org/licenses/bsd-license.php)

Vertical transformation for Geoid model OSGM15, ODN height (EPSG:5701). Used in
transformation from OSGM15 orthometric heights to ETRS89 ellipsoidal heights.
The Belfast datum is used in the Great Britain mainland onshore.

Since the original transformation should have applied to projected coordinates, this geoid model
was reprojected to suit PROJ requirements in order to be able to apply it to geographic coordinates.
Due to this fact slight inaccuracy can appear. In accordance to the Ordnance Survey developer pack
test data max error is up to 0.02 m and RMSE is up to 0.00076 m.

* uk_os_OSGM15_GB.tif

### United Kingdom: OSGB36 -> ETRS89

*Source*: [Ordnance Survey](https://www.ordnancesurvey.co.uk/business-and-government/help-and-support/navigation-technology/os-net/formats-for-developers.html)
Expand Down

0 comments on commit 0bbb5d1

Please sign in to comment.