Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jts-dev] Intersects

Hi Martin,

Currently, all relate operations fail when one geometry or the other is a GeometryCollection.

This restriction includes intersects predicate (with the notable exception of Rectangles which use a short-circuit
and can successfully return true or false with a GeometryCollection argument)

As intersects is probably the most used predicate and also a predicate for which it is quite easy
to define the semantic with geometryCollection argument, I think it could be possible to replace
the direct call to "relate" by :

for (int i = 0 ; i < this.getNumGeometries() ; i++) {
    for (int j = 0 ; other.getNumGeometries() ; j++) {
        if (this.getGeometryN(i).relate(other.getGeometryN(j)).isIntersects()) return true;
    }
}
return false;

What do you think ?

It may be more complex to handle also nested geometry collections

Michaël

Back to the top