question: private void write ( Coordinate [ ] coords , int level , StringBuffer buf ) { startLine ( "<coordinates>" , level , buf ) ; boolean isNewLine = false ; for ( int i = 0 ; i < coords . length ; i ++ ) { if ( i > 0 ) { buf . append ( TUPLE_SEPARATOR ) ; } if ( isNewLine ) { startLine ( "  " , level , buf ) ; isNewLine = false ; } write ( coords [ i ] , buf ) ; if ( ( i + 1 ) % maxCoordinatesPerLine == 0 && i < coords . length - 1 ) { buf . append ( "\n" ) ; isNewLine = true ; } } buf . append ( "</coordinates>\n" ) ; }
target:  Takes a list of coordinates and converts it to KML.<br> 2d and 3d aware. Terminates the coordinate output with a newline.