You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Validate Batch Table is valid JSON and follows the schema (have a generic validation function for this).
For this you will need to extract the batch table JSON from the buffer, using the batchTableJSONByteOffset field of the header, and then use Node's Buffer class to convert to a string, and then JSON.parse. This whole step of getting the JSON from a buffer and byte offset can be made into its own helper file since it will be used by every tile format.
You should also extract the batch table binary. This doesn't need its own helper function because it should be a one-liner in Node.
Now add a new file called validateBatchTable which takes the batch table JSON and batch table binary. In here the first step will be to validate the JSON against the schema. I think the best idea for getting the schema is getting it directly from the github url where it is hosted. For this you can use Cesium's loadJson function. Once you have the schema, use a node library to validate the batch table JSON against the schema JSON. I believe a good library for this is https://www.npmjs.com/package/ajv.
@JudyWeng
From the roadmap:
For this you will need to extract the batch table JSON from the buffer, using the
batchTableJSONByteOffset
field of the header, and then use Node's Buffer class to convert to a string, and thenJSON.parse
. This whole step of getting the JSON from a buffer and byte offset can be made into its own helper file since it will be used by every tile format.You should also extract the batch table binary. This doesn't need its own helper function because it should be a one-liner in Node.
Now add a new file called
validateBatchTable
which takes the batch table JSON and batch table binary. In here the first step will be to validate the JSON against the schema. I think the best idea for getting the schema is getting it directly from the github url where it is hosted. For this you can use Cesium'sloadJson
function. Once you have the schema, use a node library to validate the batch table JSON against the schema JSON. I believe a good library for this is https://www.npmjs.com/package/ajv.The batch table schema is located here: https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/schema/batchTable.schema.json
The text was updated successfully, but these errors were encountered: