private MultiPolygon asMultiPolygon ( List < List < List < List > > > coords , CrsId crsId ) throws IOException { if ( coords == null || coords . isEmpty ( ) ) { throw new IOException ( "A multipolygon should have at least one polyon." ) ; } Polygon [ ] polygons = new Polygon [ coords . size ( ) ] ; for ( int i = 0 ; i < coords . size ( ) ; i ++ ) { polygons [ i ] = asPolygon ( coords . get ( i ) , crsId ) ; } return new MultiPolygon ( polygons ) ; }
Parses the JSON as a MultiPolygon geometry