-
Notifications
You must be signed in to change notification settings - Fork 74
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
Additional Properties Serialization Error #854
Comments
Additionally I would have expected these serialization errors to appear somewhere in the unit test or UI but doesn't seem to be the case? |
Can you share a code sample that would let us reproduce this issue in order to track it down? |
string filePath = input.FileInput.LocalFilePath;
if (!File.Exists(filePath))
{
output.Errors.Add("Input file does not exist");
return output;
}
string data = File.ReadAllText(filePath);
FeatureCollection features = JsonConvert.DeserializeObject<FeatureCollection>(data);
Material lineMaterial = new Material("Brown", Colors.Brown);
foreach (Feature feature in features.Features)
{
if (feature.Geometry is LineString lineString)
{
List<Vector3> points = lineString.Coordinates
.Select(x => new Vector3(x.Longitude + input.XOffset, x.Latitude + input.YOffset, x.Altitude ?? -999))
.ToList();
Polyline polyline = new Polyline(points);
ModelCurve curve = polyline;
curve.AdditionalProperties = feature.Properties;
output.Count++;
output.Model.AddElement(curve);
}
} |
On the geojson file there is a property which has a GUID property but I am not currently doing anything with it: |
Describe the bug
I have an output of a function that is adding about 800 ModelCurves, and then another function reading these in and performing an operation on each of them. Interestingly the reading function can only read in about 590 ModelCurves, I then created a unit test of the second function and can verify there is the correct number of ModelCurves on the inputModel. From here I made a small modification to the unit test to expose any serialization errors and found there was in fact some warnings:
Interestingly I was also writing some properties to the AdditionalProperties property on the ModelCurve, if I comment out that functionality in the first function then the second function can read in all the ModelCurves perfectly fine.
Expected behavior
I would expect writing to AdditionalProperties should not affect the core properties of the element?
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: