Input and Output

A temporal cell value is entered using the standard temporal syntax with the underlying 64-bit cell identifier. The input parser accepts the canonical hexadecimal form each grid publishes — the form the H3 CLI and h3_cell_to_string emit, and the form the CARTO reference implementation reads — with an optional 0x prefix, in either letter case, and at most 16 significant digits. Hexadecimal is idiomatic in all three ecosystems and is what the output function emits, so every example below uses it. The value must also denote something its grid indexes: for H3 a cell, a directed edge or a vertex, so that a well-formed hexadecimal literal such as 12345, which is none of the three, is rejected rather than stored as a value with no location. For reference, the hexadecimal 480fffffffffffff used in the examples is the QUADBIN resolution-0 world cell, equal to the decimal 5192650370358181887.

The functions asBinary and asHexWKB serialize a raster or a raquet value, and rasterFromBinary, rasterFromHexWKB, raquetFromBinary and raquetFromHexWKB reconstruct it. A raster is written in the form PostGIS raster writes, so a raster column round-trips between PostgreSQL and any program reading that form. A tile carries its pixels and its QUADBIN georeferencing in one value, so it round-trips through a portable byte string with no spatial extension involved, and the hexadecimal form lets a tile column round-trip through a text-based COPY. Both output functions accept an optional endianness argument, NDR for little-endian or XDR for big-endian, defaulting to the endianness of the server.