public static Location fromCoordinates(String coordinates) {
        if (coordinates == null) {
            throw new IllegalArgumentException("Cannot create Location from null input.");
        }
        Matcher m = P.matcher(coordinates);
        if (!m.matches()) {
            throw new IllegalArgumentException(
                    coordinates + " must be on the pattern (longitude,latitude,altitude) : " + P.pattern());
        }

        try {
            Double longitude = Double.valueOf(m.group(1));
            Double latitude = Double.valueOf(m.group(2));
            Integer altitude = 0;
            if (m.group(3) != null) {
                altitude = Integer.valueOf(m.group(3).substring(1));
            }
            return new Location(longitude, latitude, altitude, "");
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException(
                    coordinates + " must be on the pattern (longitude,latitude,altitude) : " + P.pattern());
        }

    }
public static Location fromCoordinates(String coordinates) {
        if (coordinates == null) {
            throw new IllegalArgumentException("Cannot create Location from null input.");
        }
        Matcher m = P.matcher(coordinates);
        if (!m.matches()) {
            throw new IllegalArgumentException(
                    coordinates + " must be on the pattern (longitude,latitude,altitude) : " + P.pattern());
        }

        try {
            Double longitude = Double.valueOf(m.group(1));
            Double latitude = Double.valueOf(m.group(2));
            Integer altitude = 0;
            if (m.group(3) != null) {
                altitude = Integer.valueOf(m.group(3).substring(1));
            }
            return new Location(longitude, latitude, altitude, "");
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException(
                    coordinates + " must be on the pattern (longitude,latitude,altitude) : " + P.pattern());
        }

    }
public static Location fromCoordinates ( String coordinates ) { if ( coordinates == null ) { throw new IllegalArgumentException ( "Cannot create Location from null input." ) ; } Matcher m = P . matcher ( coordinates ) ; if ( ! m . matches ( ) ) { throw new IllegalArgumentException ( coordinates + " must be on the pattern (longitude,latitude,altitude) : " + P . pattern ( ) ) ; } try { Double longitude = Double . valueOf ( m . group ( 1 ) ) ; Double latitude = Double . valueOf ( m . group ( 2 ) ) ; Integer altitude = 0 ; if ( m . group ( 3 ) != null ) { altitude = Integer . valueOf ( m . group ( 3 ) . substring ( 1 ) ) ; } return new Location ( longitude , latitude , altitude , "" ) ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( coordinates + " must be on the pattern (longitude,latitude,altitude) : " + P . pattern ( ) ) ; } }
Create an untitled Location from coordinate string.

@param coordinates Coordinate string on the format longitude,latitude,altitude. Eg: 20.3,123.3,123 or 20.3,123.3
@return Instance of the location with the coordinates from the input string.
Create an untitled Location from coordinate string .