Possible bug in Rectangle.intersection

Hello everybody,

If a rectangle has zero width and height, call Cesium.Rectangle.intersection with it always returns undefined. See Source/Core/Rectangle.js (version 1.35), lines 615:

if ((rectangle.west < rectangle.east || otherRectangle.west < otherRectangle.east) && east <= west) {
return undefined;

and 622:
if (south >= north) {
return undefined;

It may well be a feature but to me it looks more like a bug. Please confirm which is the case.

Thanks, Boris.

Hi Boris,

This is actually by design. The rectangle here is empty, so there’s no intersection. We consider any 1D rectangle to be empty. I can see your point of view though – Thanks for the attention to the details of our API!


  • Rachel