Whenever an action or proceeding is brought against a county, city and county, city, or local agency, in any county, or city and county, other than the defendant, if the defendant is a county, or city and county, or, if the defendant is a city, or local agency, other than that in which the defendant is situated, the action or proceeding must be, on motion of that defendant, transferred for trial to a county, or city and county, other than that in which the plaintiff, or any of the plaintiffs, resides, or is doing business, or is situated, and other than the plaintiff county, or city and county, or county in which that plaintiff city or local agency is situated, and other than the defendant county, or city and county, or county in which the defendant city or local agency is situated; provided, however, that any action or proceeding against the city, county, city and county, or local agency for injury occurring within the city, county, or city and county, or within the county in which the local agency is situated, to person or property or person and property caused by the negligence or alleged negligence of the city, county, city and county, local agency, or its agents or employees, shall be tried in that county, or city and county, or if a city is a defendant, in the city or in the county in which the city is situated, or if a local agency is a defendant, in the county in which the local agency is situated. In that action or proceeding, the parties thereto may, by stipulation in writing, or made in open court, and entered in the minutes, agree upon any county, or city and county, for the place of trial thereof. When the action or proceeding is one in which a jury is not of right, or in case a jury is waived, then in lieu of transferring the cause, the court in the original county may request the chairperson of the Judicial Council to assign a disinterested judge from a neutral county to hear that cause and all proceedings in connection therewith. When the action or proceeding is transferred to another county for trial, a witness required to respond to a subpoena for a hearing within the original county shall be compelled to attend hearings in the county to which the cause is transferred. If the demand for transfer is made by one party and the opposing party does not consent thereto, the additional costs of the nonconsenting party occasioned by the transfer of the cause, including living and traveling expenses of the nonconsenting party and material witnesses, found by the court to be material, and called by the nonconsenting party, not to exceed five dollars ($5) per day each in excess of witness fees and mileage otherwise allowed by law, shall be assessed by the court hearing the cause against the party requesting the transfer. To the extent of that excess, those costs shall be awarded to the nonconsenting party regardless of the outcome of the trial. This section shall apply to actions or proceedings now pending or hereafter brought.
Ca. Civ. Proc. Code § 394