private void addPolygon ( double simplifyTolerance , BoundingBox boundingBox , ProjectionTransform transform , Path path , Polygon polygon ) { List < LineString > rings = polygon . getRings ( ) ; if ( ! rings . isEmpty ( ) ) { // Add the polygon points LineString polygonLineString = rings . get ( 0 ) ; List < Point > polygonPoints = polygonLineString . getPoints ( ) ; if ( polygonPoints . size ( ) >= 2 ) { addRing ( simplifyTolerance , boundingBox , transform , path , polygonPoints ) ; // Add the holes for ( int i = 1 ; i < rings . size ( ) ; i ++ ) { LineString holeLineString = rings . get ( i ) ; List < Point > holePoints = holeLineString . getPoints ( ) ; if ( holePoints . size ( ) >= 2 ) { addRing ( simplifyTolerance , boundingBox , transform , path , holePoints ) ; } } } } }
Add the polygon on the canvas