"Invalid URI: The Uri is too long" error with czml-writer

I recently updated to the latest czml-writer and I used to write the gltf model to the czml as follows:

using (var model = entity.OpenModelProperty())



model.WriteGltfProperty(new CesiumResource(“C:/Users/user/Desktop/test.gltf”, CesiumResourceBehavior.Embed));





Now the WriteGltfProperty requires a Uri but when I update that line to the following I get the Uri is too long error. Anyone know what I’m doing wrong?

model.WriteGltfProperty(new CesiumResource(new Uri(“C:/Users/user/Desktop/test.gltf”), CesiumResourceBehavior.Embed));

It looks like .NET has a hard-coded limit on Uri length, around 65k characters. I think we’ll have to back out the recent change to require Uri parameters everywhere in order to allow embedding large glTF models in CZML.

Thanks Scott! I confirmed that a simple model works in the same way I’m using Uri so my model must be larger than the limit.

I just opened https://github.com/AnalyticalGraphicsInc/czml-writer/pull/96 to go back to using string instead of Uri which will fix the issue.