/** * Creates a new LatLong from a comma-separated string of coordinates in the order latitude, longitude. All * coordinate values must be in degrees. * * @param latLongString the string that describes the LatLong. * @return a new LatLong with the given coordinates. * @throws IllegalArgumentException if the string cannot be parsed or describes an invalid LatLong. */ public static LatLong fromString(String latLongString) { double[] coordinates = parseCoordinateString(latLongString, 2); return new LatLong(coordinates[0], coordinates[1]); }
/** * Creates a new BoundingBox from a comma-separated string of coordinates in the order minLat, minLon, maxLat, * maxLon. All coordinate values must be in degrees. * * @param boundingBoxString the string that describes the BoundingBox. * @return a new BoundingBox with the given coordinates. * @throws IllegalArgumentException if the string cannot be parsed or describes an invalid BoundingBox. */ public static BoundingBox fromString(String boundingBoxString) { double[] coordinates = LatLongUtils.parseCoordinateString(boundingBoxString, 4); return new BoundingBox(coordinates[0], coordinates[1], coordinates[2], coordinates[3]); }
/** * Creates a new BoundingBox from a comma-separated string of coordinates in the order minLat, minLon, maxLat, * maxLon. All coordinate values must be in degrees. * * @param boundingBoxString the string that describes the BoundingBox. * @return a new BoundingBox with the given coordinates. * @throws IllegalArgumentException if the string cannot be parsed or describes an invalid BoundingBox. */ public static BoundingBox fromString(String boundingBoxString) { double[] coordinates = LatLongUtils.parseCoordinateString(boundingBoxString, 4); return new BoundingBox(coordinates[0], coordinates[1], coordinates[2], coordinates[3]); }
/** * Creates a new LatLong from a comma-separated string of coordinates in the order latitude, longitude. All * coordinate values must be in degrees. * * @param latLongString the string that describes the LatLong. * @return a new LatLong with the given coordinates. * @throws IllegalArgumentException if the string cannot be parsed or describes an invalid LatLong. */ public static LatLong fromString(String latLongString) { double[] coordinates = parseCoordinateString(latLongString, 2); return new LatLong(coordinates[0], coordinates[1]); }