The athena way is what aegis uses, it reads the 4th dword in the cell info struct and compares it with the map water level read from the RSW, the code roughly looks like this (quick draft so i apologize if it's not so clear).
{
std::ifstream gat_fs(filename, std::ios::binary);
VALIDATE_MAGIC(gat_fs, "GRAT", 4);
gat_fs.read(reinterpret_cast<char *>(&m_verMajor), sizeof(char));
gat_fs.read(reinterpret_cast<char *>(&m_verMinor), sizeof(char));
gat_fs.read(reinterpret_cast<char *>(&m_width), sizeof(int));
gat_fs.read(reinterpret_cast<char *>(&m_height), sizeof(int));
m_cells.resize(m_width * m_height);
gat_fs.read(reinterpret_cast<char *>(m_cells.data()), m_cells.size());
std::for_each(m_cells.begin(), m_cells.end(), [idx = 0](struct CAttrCell &cell) mutable {
if (cell.flag == 1 || cell.flag == 5)
m_TileInfo[idx] |= SVR_CELL_BLOCK;
if (cell.flag != 1)
m_TileInfo[idx] |= SVR_CELL_ARROW;
if (cell.h1 > m_waterLevel) // m_waterLevel from RSW
m_TileInfo[idx] |= SVR_CELL_WATER;
++idx;
});
return 0;
}