Skip to content

GeometryType encoding mismatch spec <-> encoder/decoder #1089

@CommanderStorm

Description

@CommanderStorm

There is a discrepancy between the MapLibre Tile specification and all current reference implementations (C++, Java, Rust, and TypeScript) regarding the encoding of the GeometryType stream.

The spec states:

Byte-RLE

This encoding compresses byte streams, such as the GeometryType stream in Geometry columns. Refer to the ORC specification for implementation details.

Our impl does:

Use Integer RLE instead of Byte-RLE for the GeometryType column

  • rust -> rust/mlt-core/src/layer/v01/geometry/decode.rs uses decode_bits_u32(), which eventually calls decode_rle
  • java -> java/mlt-core/src/main/java/org/maplibre/mlt/decoder/IntegerDecoder.java uses decodeRLE for integer arrays
  • cpp -> cpp/src/mlt/decode/geometry.hpp uses intDecoder.decodeIntStream

So in practice:

  • either we do a breaking fix
  • remove the currently unused byte-rle

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions