Hi,
Sometimes we receive this exception(when working with contour) : “The shape you provided does not pass our simple validation.This ring is not closed. To close a ring the last point must be the same as the first point. All rings must have at least four points.” to solve it we should increase or decreasing size of cells.
What’s the root of this problem?
Regards,
Ben
The shape you provided does not pass our simple validation
Hi Ben,
This is because some of your data is not valid, if you use:
RingShape a = new RingShape();
a.Vertices.Add(new Vertex(30, 10));
a.Vertices.Add(new Vertex(10, 20));
a.Vertices.Add(new Vertex(20, 40));
a.GetWellKnownBinary();
Then the same exception will be thrown, but if you use:
RingShape a = new RingShape();
a.Vertices.Add(new Vertex(30, 10));
a.Vertices.Add(new Vertex(10, 20));
a.Vertices.Add(new Vertex(20, 40));
a.Vertices.Add(new Vertex(30, 10));
a.GetWellKnownBinary();
Then the exception will not be thrown.
The reason for this exception is that there are only three vertexes in a ringshape but three vertexes actually could not form a ring.
Hope it helps
Summer
Many thanks for your answer,
I’m receiving this exception when running this line:
IsoLineLayer.GetIsoFeatures(gridFeatureSource.GenerateGridMatrix(),isoLineBreaks, “GridCellValue”, IsoLineType.ClosedLinesAsPolygons);
Therefore it seems that internally you create some feature which are not right feature.
to give you a clue, to solve this problem I normally change the Cell size(Increase/Decrease) of Grid’s Contour file and it solve the problem.
Regards,
Ben
Hi Ben,
Thanks for sharing this with us and great to hear the problem is solved, once we have enough resource, we will look deeper into this problem you mentioned.
if you have any more question , please feel free to let us know.
Best Regards
Summer
Hi Summer,
The way I mentioned to solve a problem is very temporarily solution, because we can not keep asking user to change Column/Row(cell size) to find cell size which is working(not throwing exception).
We can not ask user to increase the cell size and if it doesn’t work decrease the cell size and it may or may not work.
I think this is a bug on contour tool, internally when you create IsoFeature, it would be great to check the feature and if it’s not right feature, instead of throw exception you try to manage it and changing Isofeature.
Regards,
Ben
Hi Ben,
I think you are right, would you please provide us your data for a further debug?
Best Regards
Summer
Thanks for your sample project Ben,
I believe this has been fixed in the latest build (7.0.46.0), please give a try and feel free to let us know if you still have any questions.
Thanks,
Jack
Hi Ben,
Thanks for your sample and detail information. We have fixed the issue you mentioned. Could you please try the latest version 7.0.49.0 or 7.0.0.49, we are building it and will be available in hours. If you have any question, please feel free to let us know.
Hope it helps.
Summer