private static void decompose ( Geometry geometry , Collection < Geometry > list ) { for ( int i = 0 ; i < geometry . getNumGeometries ( ) ; i ++ ) { Geometry component = geometry . getGeometryN ( i ) ; if ( component instanceof GeometryCollection ) { decompose ( component , list ) ; } else { list . add ( component ) ; } } }
Decompose a geometry recursively into simple components .