Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uk_os_OSGM15_GB.tif geoid file for ODN height, UK #25

Merged
merged 5 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions copyright_and_licenses.csv
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ se_lantmateriet_README.txt,Disclaimed,Public domain
se_lantmateriet_SWEN17_RH2000.tif,Lantmäteriet,CC0-1.0
sk_gku_JTSK03_to_JTSK.tif,Copyright 2013 - 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 @@ -215,6 +215,7 @@ se_lantmateriet_SWEN17_RH2000.tif
sk_gku_JTSK03_to_JTSK.tif
sk_gku_README.txt
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