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
| Value | Description |
|---|---|
| 89c25 | Token used in the S2 library tests |
| X invalid | Token of the invalid cell id 0 |
| 89c250 invalid | Trailing zeros are removed |
Sources
- doc: http://s2geometry.io/devguide/s2cell_hierarchy
- doc: https://github.com/google/s2geometry/blob/master/src/s2/s2cell_id.h
Use this record
- Page URL:
http://registry.apicrafter.io/datatype/s2_cell_token - JSON: API v1 · legacy shape (used by metacrafter) · Markdown (for LLMs)
- Improve it: edit
data/datatypes/any/geo/s2_cell_token.yamlon GitHub