Skip to content

Java: BooleanEncoder truncates JSON output at last true bit #569

@Weixing-Zhang

Description

@Weixing-Zhang

Issue

When encoding boolean values, the JSON output is truncated at the last true bit while the binary data correctly includes all values up to num_values.

Reproduction

Test fixture: ../../test/fixtures/amazon_here/4_9_4/prop_country_capital_present.bin

This fixture was generated using the Java encoder:

fd . ../test/fixtures -e pbf -x java -jar build/libs/encode.jar --mvt {} --mlt $(tmp='{.}'; echo ${tmp/\/fixtures\///expected/}).mvt --rawstreams --tessellate --outlines \* --verbose

Current Behavior

For RLE encoded data [fd, 00, c0, 03] with num_values = 21:

  • JSON output truncates at 18 values (last true bit position) -> expected:
[false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true]
  • Binary data correctly includes all 21 values -> should be
[false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,false,false,false]

Expected Behavior

JSON output should include all values up to num_values (21) to match the binary data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjavaPull requests that update Java code

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions