Skip to content

Commit

Permalink
fixup! uk_os: add script to generate uk_os_OSGM15_GB.tif from source …
Browse files Browse the repository at this point in the history
…data
  • Loading branch information
and-marsh committed Jun 3, 2020
1 parent c17674c commit f3a029c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions uk_os/OSGM15_GB.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ ETRS89_BRITISH_NAT_GRID='PROJCS["ETRS89 / British National Grid",
AXIS["Northing",NORTH]]
'
RES_LAT=0.008983192446931791 # RES_NORTHING/(PI*GRS80_RAD/180)
RES_LONG=0.00509465706621704 # RES_LAT*cos(MID_AREA_LAT)
# RMSE = 0.000762624030848561m
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:4258 osgm15_temp osgm15_temp.tif
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
Expand Down

0 comments on commit f3a029c

Please sign in to comment.