Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary representation for explicit tiles #635

Open
lilleyse opened this issue Feb 22, 2022 · 0 comments
Open

Binary representation for explicit tiles #635

lilleyse opened this issue Feb 22, 2022 · 0 comments

Comments

@lilleyse
Copy link
Contributor

lilleyse commented Feb 22, 2022

The JSON tree structure for explicit tiling can get quite bulky, especially as new metadata properties are added. It would be more concise to encode tiles in binary.

The general idea is to model this after subtrees where each tile conforms to a class and tile metadata is stored in a property table.

There would be a tile class that defines the structure of each tile. It would make heavy use of semantics. This would include semantics that define the bounding volumes (TILE_BOUNDING_SPHERE, TILE_BOUNDING_REGION, TILE_BOUNDING_BOX), a semantic for referring to tile content (TILE_CONTENT_IDS), and a semantic for referring to child tiles (TILE_CHILDREN_IDS). There would also be semantics for geometric error, transform, and other built-in tile properties. The class could also have user defined properties (aka metadata).

There would also be a class for tile content. This would have bounding volume semantics and a CONTENT_URI semantic, as well as user defined properties.

So far this is no different than how metadata works today. Tiles could be encoded in a binary property table, same with tile contents.

TILE_CHILDREN_IDS is what determines the tree structure. This semantic would be a variable-length array of indices into the tile table. Cyclic chains would need to be forbidden. TILE_CONTENT_IDS would link tiles with their content. It would be a variable-length array of indices into the content table.

tileset.json would need to have buffers and bufferViews to store the data.

Mockup of what this might look like:

schema.json: country and triangleCount are custom properties

{
  "schema": {
    "classes": {
      "tile": {
        "properties": {
          "boundingVolume": {
              "semantic": "TILE_BOUNDING_SPHERE",
              "type": "SCALAR",
              "componentType": "FLOAT64",
              "array": true,
              "count": 4
          },
          "contents": {
              "semantic": "TILE_CONTENT_IDS",
              "type": "SCALAR",
              "componentType": "UINT32",
              "array": true
          },
          "children": {
              "semantic": "TILE_CHILDREN_IDS",
              "type": "SCALAR",
              "componentType": "UINT32",
              "array": true
          },
          "country": {
            "type": "STRING"
          }
        }
      },
      "contents": {
        "properties": {
          "uri": {
            "semantic": "CONTENT_URI",
            "type": "STRING"
          },
          "triangleCount": {
            "type": "SCALAR",
            "componentType": "UINT32"
          }
        }
      }
    }
  }
}

tileset.json

{
  "tiles": {
    "class": "tile",
    "properties": {
      "boundingVolume": {
        "values": 0
      },
      "contents": {
        "values": 1,
        "arrayOffsets": 2
      },
      "children": {
        "values": 3,
        "arrayOffsets": 4
      },
      "country": {
        "values": 5,
        "stringOffsets": 6
      }
    }
  },
  "content": {
    "class": "content",
    "properties": {
      "uri": {
        "values": 5,
        "stringOffsets": 6
      },
      "triangleCount": {
        "values": 7
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant