computes a geometry containing only polygonal components.extracts the polygon s from the input and returns them as an appropriate polygonal geometry . if the input is already polygonal , it is returned unchanged . a particular use case is to filter out non-polygonal components returned from an overlay operation . concode_field_sep int STRTREE_NODE_CAPACITY concode_elem_sep Collection inputPolys concode_elem_sep GeometryFactory geomFactory concode_field_sep List reduceToGeometries concode_elem_sep Geometry unionUsingEnvelopeIntersection concode_elem_sep Geometry bufferUnion concode_elem_sep Geometry bufferUnion concode_elem_sep Geometry unionActual concode_elem_sep Geometry binaryUnion concode_elem_sep Geometry binaryUnion concode_elem_sep Geometry unionSafe concode_elem_sep Geometry getGeometry concode_elem_sep Geometry unionOptimized concode_elem_sep Geometry extractByEnvelope concode_elem_sep Geometry union concode_elem_sep Geometry union concode_elem_sep Geometry unionTree concode_elem_sep Geometry repeatedUnion
Geometry function ( Geometry arg0 ) { if ( arg0 instanceof Polygonal ) { return arg0 ; } List loc0 = PolygonExtracter . getPolygons ( arg0 ) ; if ( loc0 . size ( ) == 1 ) return ( Polygon ) loc0 . get ( 0 ) ; return arg0 . getFactory ( ) . createMultiPolygon ( GeometryFactory . toPolygonArray ( loc0 ) ) ; }