Datatypes

S2 cell token

ID s2_cell_token

DatatypeNot PIIidentifierDraft

This record is a draft: it has not been reviewed yet and may be incomplete or wrong. Do not rely on it for compliance decisions. Help improve it (see CONTRIBUTING.md).

Token of a cell of the S2 Geometry library, which projects the sphere onto the six faces of a cube and divides each face into a hierarchy of cells along a Hilbert curve. The token is the 64-bit cell id in lowercase hexadecimal with the trailing zeros removed, so larger cells have shorter tokens, up to 16 characters. The top three bits hold the cube face (0 to 5), so a token begins with 0-9, a or b and does not end in 0; the id 0 is written X. The regexp only checks this shape, so it also matches other short hexadecimal strings.

Categories
Geographic identifiers
Countries
Global (not tied to a country)
Languages
Common to most languages
Quality
68/100 · missing: second example, mapping (Wikidata, Schema.org, ...), translation, detector coverage
Metacrafter rules
no detection rule yet
Supported by tools
no tool record lists this type yet

Regular expression

^(?:[1-9ab]|[0-9ab][0-9a-f]{0,14}[1-9a-f])$

Python re syntax.

Examples

ValueDescription
89c25Token used in the S2 library tests
X invalidToken of the invalid cell id 0
89c250 invalidTrailing zeros are removed

Sources

Use this record