When and how do you handle "Expected value to be greater than or equal to 0.0125" ?

I have a few questions:

  1. Why does this check happen? Is it because if two points are on opposite side of planet Earth, you don’t know which direction to draw the polyline to?
  2. When does this check happen? We have already written a lot of code for entities, and now we have no idea if this validation needs to happen only for polylines, or we should check other entities, too.
  3. Is there a way to get a more helpful error that points towards the actual entity throwing the error?
  4. Why am I able to reproduce this error for polyline entities but when I use primitives, the same coordinates don’t throw the error?

Sandcastle links:

  1. Drawing entities between Alejos and Wellington with entity framework. Click the option to draw the polyline and observe the crash:

https://sandcastle.cesium.com/#c=tVhtc9o4EP4rusx9MDNEYMyLSdPMUaCEKQWG0GZujk4jbAG6CouRRCjN8N9v5RewidN0bu7oh9ra3Uer1e6z63giUBo9MrqjEr1FAd2hNlVsu8afwzVrduGF720RaMICKmcXRfQ0CxDSbE05rFyhBeGKFs0aCdiaaCaC9OKcKDogeyrHzPtGZVq0pMITvlmLd+2LoBetjaV4ZCCa7jcU90aj3qALJofCm1nghU4rjwYUfI6cx+ErCMP/8ZKLOcU+3ejVlCrdWoLvSk+plPAARlpujbL5F6ERTv8WCiRPiMMJ9NaHg1Vt7JQbtu24RcRFsIyXL2u4Uqk7VbdWBLtEuVKpuOhwdG9HOURnqUVwBnoJqJVaxS3bjQyq3ajiesN2a66ThnVq9UYtxJ0FnAKukNyPDwKLWu6j60ivw45kR5hOoupJSjS9T2m01D7wLBNMlAkg1pE8iT4gnW2IUDrCaiV2oBPeKAgPyCPaWyEL1IUsxJ6xwBc7DBGW2nqYrqikaEcUJAsK1VDoHsQq2grFLmD0+1MoPzwYPw/ZADBOFdXPAxCt5wegJ8SS0/FKaAHvnCnNPKcTm1ghCEKlEhoFfI/0iqLIAMUZCY6Cy3OKtor6cCq9ShSykMjpoBAUI3QHvhikhzjTH9BGig0EYo/EIpTEtRcmjdx6gIPExpSQQlqgn9YDjjwW4O4nBfG7B5cij3rHujKJHpbaIeeyN5KtmWaP4CrxfSsdwcJLt2kcFZxiLpbWQze8Py6Ib67vhTAA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TW9Tgq6ppQ9d1bKdZrbnpKFaaDdeuVXDFrddq1Zpt14/C84FAhGzzC87AdlXcbFTLTbfecGv1dLAuG00HO1W72Wi6ZRe+zuy0M9VmEzfhEG693Kg7dsryWbV4ZE0lgQQU31raigJVjH38ufJUQoMzJWvFh4Ackex7Ffc73eEUOK+QPyVeFC+uld5zepOg/8HWhg3QVnIL45Kma8MGVJXmW2BDjT2lEqzrUtr02mePiPlvc/4OYGpBKZAstjwcY2YXN9cl0H9mGn8gjKAvcrI3aiv7ZhAtYoyvS/Cab6mjwfYM+R8

  1. SAME coordinates drawn with primitives does not throw an error:

Only a quick pointer for now:

  1. Why does this check happen? Is it because if two points are on opposite side of planet Earth, you don’t know which direction to draw the polyline to?

Probably yes: The error seems to be the same as in Drawing lines to the poles results in error - #2 by Marco13, where I explained the reason and a possible workaround

Regarding the other points: I agree that this could be handled better. The value of 0.0125 seems arbitrary. And when you imagine something like a user interactively clicking positions on the globe, then this error could happen at any point in time, with no reasonable way to handle or avoid it.

(@cesium-cesiumjs : Maybe this should be tracked in an issue. An issue with the same message was coincidentally updated 2 weeks ago, at Incorrect CZML-Corridor behavior · Issue #12501 · CesiumGS/cesium · GitHub , but there, it might only be a detail in an otherwise broader context of CZML handling…)