ept-tools icon indicating copy to clipboard operation
ept-tools copied to clipboard

Invalid feature table alignment

Open ulrichson opened this issue 1 year ago • 2 comments

Hello,

I was running the 3d-tiles-validator on a tileset created with ept-tools and it threw errors, mentioning that the feature table is not aligned correctly, e.g.:

{
  "type": "CONTENT_VALIDATION_ERROR",
  "path": "1-0-0-0.pnts",
  "message": "1-0-0-0.pnts caused validation errors",
  "severity": "ERROR",
  "causes": [
    {
      "type": "BINARY_INVALID_ALIGNMENT",
      "path": "1-0-0-0.pnts",
      "message": "The feature table binary must be aligned to 8 bytes",
      "severity": "ERROR"
    }
  ]
}

According to the feature table spec the start position must also be aligned:

The binary body shall start and end on an 8-byte boundary within the containing tile binary. The binary body shall be padded with additional bytes, of any value, to satisfy this requirement.

Currently, the ept-tools don't do that and thus I created a fork with following changes:

https://github.com/connormanning/ept-tools/compare/master...ulrichson:ept-tools:byte-alignment-fix?expand=1 (in these changes there is also another fix, i.e. the children array must not be empty according to the validator)

With these modifications, the 3d-tiles-validator doesn't complain.


Do you agree, that this would be the correct implementation?

I can open a PR, although tests will fail currently since they assume a different format.

ulrichson avatar Jul 05 '23 11:07 ulrichson

Something like this is likely correct, I remember fixing this once on a development branch I was working on internally.

This issue aside, you might consider using viewer.copc.io instead, which will translate your dataset from EPT/COPC to 3D Tiles in the browser so you are not required to translate them to 3D Tiles on disk or use an EPT Tools server - just point at your data over HTTP. See for example COPC and EPT (the Cesium links here) sample data.

I should update the readme for this repo to point at that... and I'll see if I can dig up my existing fix for this issue.

connormanning avatar Jul 05 '23 14:07 connormanning

@connormanning thanks! I will look into it!

ulrichson avatar Jul 06 '23 11:07 ulrichson