public static void appendKMLCoordinates ( Coordinate [ ] coords , StringBuilder sb ) { sb . append ( "<coordinates>" ) ; for ( int i = 0 ; i < coords . length ; i ++ ) { Coordinate coord = coords [ i ] ; sb . append ( coord . x ) . append ( "," ) . append ( coord . y ) ; if ( ! Double . isNaN ( coord . z ) ) { sb . append ( "," ) . append ( coord . z ) ; } if ( i < coords . length - 1 ) { sb . append ( " " ) ; } } sb . append ( "</coordinates>" ) ; }
Build a string represention to kml coordinates