and got the impression that only geometries of the single-instance types (Point, LineString, LinearRing) are passed to the void filter(Geometry) method of the filter class.
This is not true though, even the explicitly stated example for Polygon geometry is not correct.
Right, the documentation is incorrect. Since this behaviour has been in place a long time, the only thing to do is to update the doc to reflect the actual behaviour of the filter.
I'm tempted to implement the
GeometryComponentFilter
interface. I have read the documentationhttps://github.com/locationtech/jts/blob/d7447be42bacc0a4fd040362f26f4b7506f9e2fd/modules/core/src/main/java/org/locationtech/jts/geom/GeometryComponentFilter.java#L15-L35
and got the impression that only geometries of the single-instance types (Point, LineString, LinearRing) are passed to the
void filter(Geometry)
method of the filter class.This is not true though, even the explicitly stated example for
Polygon
geometry is not correct.Please check the following unit test: