public List < List < List < Double > > > getCoordinates ( ) { List < List < List < Double >>> polygon = new ArrayList < List < List < Double > > > ( ) ; for ( LineString lineString : coordinates ) { polygon . add ( lineString . getCoordinates ( ) ) ; } return polygon ; }
Should throw is not a polygon exception