protected static GeoPoint parseKmlCoord(String input){
  int end1=input.indexOf(',');
  int end2=input.indexOf(',',end1 + 1);
  try {
    if (end2 == -1) {
      double lon=Double.parseDouble(input.substring(0,end1));
      double lat=Double.parseDouble(input.substring(end1 + 1,input.length()));
      return new GeoPoint(lat,lon);
    }
 else {
      double lon=Double.parseDouble(input.substring(0,end1));
      double lat=Double.parseDouble(input.substring(end1 + 1,end2));
      double alt=Double.parseDouble(input.substring(end2 + 1,input.length()));
      return new GeoPoint(lat,lon,alt);
    }
  }
 catch (  NumberFormatException e) {
    return null;
  }
catch (  IndexOutOfBoundsException e) {
    return null;
  }
}

protected static GeoPoint parseKmlCoord ( String input ) { int end1 = input . indexOf ( ',' ) ; int end2 = input . indexOf ( ',' , end1 + 1 ) ; try { if ( end2 == - 1 ) { double lon = Double . parseDouble ( input . substring ( 0 , end1 ) ) ; double lat = Double . parseDouble ( input . substring ( end1 + 1 , input . length ( ) ) ) ; return new GeoPoint ( lat , lon ) ; } else { double lon = Double . parseDouble ( input . substring ( 0 , end1 ) ) ; double lat = Double . parseDouble ( input . substring ( end1 + 1 , end2 ) ) ; double alt = Double . parseDouble ( input . substring ( end2 + 1 , input . length ( ) ) ) ; return new GeoPoint ( lat , lon , alt ) ; } } catch ( NumberFormatException e ) { return null ; } catch ( IndexOutOfBoundsException e ) { return null ; } }
similar to geopoint . frominverteddoublestring , with exceptions handling
