Looking forward to receiving my TX2 this week. I’m trying to get set up beforehand. How do you convert the NOAA geoid data into the gtx format for use with SW Maps? (data URL: GEOID12B Alaska Data Download )
I see several posts back on Sparkfun from years ago about something else but I don’t see an obvious way to do it today.
ChatGPT whipped out this script, and it claims to create the same .gtx file when using the official NOAA .bin file (BE - from your link) as the source. I don’t know that Eye4Software requires LE specifically (my previous post), so just be aware the script below uses Grid0, BE.
#!/usr/bin/env python3
"""
NOAA Big-Endian Geoid BIN to GTX Converter
Suggested filename:
noaa_geoid_be_to_gtx.py
Converts NOAA Big-Endian geoid (.bin) files that use the standard
NOAA binary format to the standard GTX format.
Place this script in the same folder as the downloaded NOAA
Big-Endian (.bin) file. Change INPUT_FILE and OUTPUT_FILE
below if the filenames are different.
"""
INPUT_FILE = "g2012ba0.bin"
OUTPUT_FILE = "g2012ba0.gtx"
NEGATIVE_ZERO = b"\x80\x00\x00\x00"
POSITIVE_ZERO = b"\x00\x00\x00\x00"
with open(INPUT_FILE, "rb") as source:
# Copy the standard 40-byte GTX header.
header = source.read(40)
# NOAA Big-Endian BIN files include one additional 4-byte integer
# after the header that is not part of the GTX format.
source.read(4)
# Read the remaining grid values.
grid_data = source.read()
# Normalize any IEEE-754 negative-zero (-0.0) values to positive zero
# (+0.0). This does not change the numeric values but produces the
# standard GTX representation.
grid_data = grid_data.replace(NEGATIVE_ZERO, POSITIVE_ZERO)
with open(OUTPUT_FILE, "wb") as target:
target.write(header)
target.write(grid_data)
print(f"Conversion complete: {OUTPUT_FILE}")
[Edit]
For future reference, I just tested this script for Geoid18, Grid7 (my location).
I loaded the new .gtx file that ChatGPT created into SW Maps (iOS version) and it worked fine.
I even created a fake .gtx file where all points in the geoid have a +1m error on purpose.
The HAE differed by only 0.006 m between the two points (RTK delta), so after accounting for that, the applied geoid shift was +0.999 m for the fake geoid.
Note: I didn’t check the Geoid against a known network control point. This was just to test if SW Maps correctly used the .gtx Geoid file.
Fun Fact: During this quick test, I also learned that the decimated built-in Geoid in the LG290P (I’ve always assumed it’s EGM96) differs from GEOID18 by about 0.86 m at this particular location.
Thanks, that’s super! I didn’t realize you could download in the GTX format straight from the NOAA VDatum page. Good to have the converter script too. Time to go try it out with the unit!