public static JsonArray geoJSONCoordinates(ArrayList<GeoPoint> coordinates){
  JsonArray json=new JsonArray();
  Iterator<GeoPoint> it=coordinates.iterator();
  while (it.hasNext()) {
    GeoPoint position=it.next();
    json.add(KmlGeometry.geoJSONPosition(position));
  }
  return json;
}

public static JsonArray geoJSONCoordinates ( ArrayList < GeoPoint > coordinates ) { JsonArray json = new JsonArray ( ) ; Iterator < GeoPoint > it = coordinates . iterator ( ) ; while ( it . hasNext ( ) ) { GeoPoint position = it . next ( ) ; json . add ( KmlGeometry . geoJSONPosition ( position ) ) ; } return json ; }
build an array of positions in geojson format .
