3D Vector Tiles

Hello Cesium Community,

I am currently working on a project that involves converting a shapefile (or any other GIS dataset) data into the 3D Tiles vector tile format. I have been studying the Vector Data documentation i found on this sandcastle (Cesium Sandcastle) and am seeking guidance on the best approach to achieve this, as the sandcastle is basically what im trying to acheive.

I have a shapefile with the following headers:

(fid, toid, abp_class, abp_class_, cibse_cate, cluster_id, is_residen, postcode, addresses, layer_name, demand_sou, on_network, heating_sy, heating__1, heating__2, heating__3, heat_deman, peak_deman, insulation, insulati_1, mandated, mandatable, is_substat, substation, substati_1, substati_2, substati_3, substati_4, max_heat_p)

I need to map these attributes to the semantics of a vector tile as described in the 3D Tiles specification.

What I Have Done:

  • I have extracted the geometric data and attributes from the shapefile.
  • I have reviewed the JSON schema for a vector tile and understand the header and body layout.

What I Need Help With:

  • How to encode the shapefile attributes and geometries into the binary format required by the vector tile’s feature table.
  • Understanding the delta and ZigZag encoding process for the positions buffer.
  • Any examples or references to existing tools or scripts that can facilitate this process.

Questions:

  1. Are there existing tools within the Cesium ecosystem that can perform this conversion, or is this a process that needs a custom script?
  2. What are the best practices for ensuring the encoded vector tile data aligns correctly with the Cesium rendering engine?
  3. Can you provide any examples or sample code that illustrates the process of converting shapefile attributes to vector tile semantics?

I would greatly appreciate any advice, resources, or examples you could share to help me proceed with this conversion.

Thank you for your time and assistance.

As the comment in the linked Sandcastle says: The vctr tile format is experimental. CesiumJS is (and will be) able to consume these .vctr files. But beyond that, there is not much publicly available tooling support for this format.

There are some high-level questions or comments that I’m bringing up here, maybe some decisions or clearer ideas can be derived from that:

  • You mentioned “shapefile /or any other GIS dataset)”: When you upload a KML file to Cesium ion, then it will be converted into a 3D Tiles data set with .vctr files. Maybe that’s a viable path, depending on your exact input data or your options for converting it into other formats
  • You could consider to not use .vctr tiles, but glTF+Metadata instead. The migration guide in the specification describes how to represent the other tile formats (B3DM, PNTS, etc) as glTF with additional metadata extensions. It does not contain guides for vctr, but may contain some relevant links. (The reasoning here is that glTF may have broader tooling support and might be easier to handle and generate than vctr)

When you want to create .vctr files manually your own input, then it will be necessary to create a custom implementation for that. The CesiumJS implementation for reading vector tiles in Vector3DTileContent.js could help to show how the data will be decoded that you are trying to create.