Tests if coordinates are valid