*648Opinion
BIGELOW, P. J.This matter involves the City of Los Angeles’s (City) attempt to install a sewer line outside of its territorial limits in an unincorporated area of Los Angeles County (County). The County sought a writ of mandate and declaratory relief against the City to halt construction of the proposed sewer line. The trial court granted the County’s writ petition, enjoining the City from proceeding without first obtaining the County’s consent or a judicial determination of the terms and conditions and location for the use of the County street. We conclude the trial court misinterpreted the applicable statutory framework and employed the wrong standard of review. Accordingly, we reverse and remand with directions.
FACTS
Sewage from coastal areas of the City is pumped to the Hyperion Treatment Plant in Playa del Rey via the Venice pumping plant. The Venice pumping plant is the largest wastewater pumping plant in the City and its existing 48-inch diameter force main sewer line can only handle about 60 percent of the flows coming from the plant. The 48-inch sewer pipe has been in continuous operation since it was built in 1958 because it is the only feasible way to convey sewage flows to the Hyperion Treatment Plant. If flows into the Venice pumping plant exceed flows out of the plant, there is a risk that wastewater will overflow directly into Baliona Lagoon. This nearly happened during heavy storms in 1994, 1995, 2004 and 2005.
In an effort to address the maintenance needs of the existing 48-inch pipeline and provide additional capacity, the City proposed to install a new 54-inch diameter sewer pipe running under Via Marina from the Venice pumping plant (Via Marina route). The Via Marina route would run primarily under city streets, but a small portion of it would run underneath public streets and a public parking lot located in an unincorporated area of the County. The City considered several routes for the new pipeline, including one that ran solely under city streets (Pacific Avenue route) and one that ran along the beach. Due to environmental concerns relating to the beach route, the Pacific Avenue route and the Via Marina route were the only two options seriously considered by the City. The city council ultimately approved construction of the sewer pipeline along the Via Marina route on January 12, 2010. Although it appears the County was aware of the City’s plans throughout the proceedings, the County never agreed to them.
*649As a result, the County filed a petition for writ of mandate on February 16, 2010, alleging violations of Public Utilities Code sections 10101 to 101051 and the California Environmental Quality Act (CEQA; Pub. Resources Code, § 21000 et seq.) as well as a complaint for declaratory relief. The County alleged the City failed to seek its approval as required under section 10103 to construct the pipeline or seek a judicial determination of its rights under section 10104. The County alleged that the Pacific Avenue route was the environmentally superior route and would have the least impact. A first amended petition was filed on July 8, 2010. The City demurred on the ground that sections 10103 and 10104 did not apply because it properly exercised its police power to construct the sewer pipeline outside of city limits. The City also argued that section 10105 permitted the City to construct the sewer pipeline along the Via Marina route because it was necessary and convenient. The trial court overruled the demurrer.
Following extensive briefing and argument, the trial court granted the County’s petition for writ of mandate by order dated July 28, 2011. While the trial court rejected the County’s CEQA challenge, it found the City violated the Public Utilities Code when it failed to obtain the County’s permission to use the Via Marina route or seek a judicial determination about the project. The City timely appealed.
DISCUSSION
On appeal, the City contends it may locate a sewer line under county land pursuant to its police powers and sections 10101 to 10105. While we are not persuaded that the City has absolute authority to pursue such an extraterritorial incursion, we conclude that section 10105 permits the City to locate its sewer lines under county land where it is a necessary or convenient part of the proposed works.
The City first relies on Southern Cal. Gas Co. v. City of L. A. (1958) 50 Cal.2d 713 [329 P.2d 289] (Southern Cal. Gas) to argue that its police powers grant it absolute authority to extend its sewer line into county territory. In Southern Cal. Gas, the Supreme Court explained, the power of a city to provide sewage disposal services is one of a city’s most important government powers and “is one of the few powers it may exercise outside of its territorial limits without express authorization.” (Id. at p. 718.) Contrary to the City’s position, Southern Cal. Gas does not override or contradict the Public Utilities Code. Indeed, it is easily harmonized with sections 10101 to 10105. As discussed below, the Public Utilities Code allows a city to locate sewage disposal services outside of its jurisdictional limits without *650express authorization, subject either to judicial determination under section 10104 or the necessary or convenient exception articulated in section 10105, depending on whether the sewer is to be located under the land of another municipality or in unincorporated land, respectively. The Southern Cal. Gas court did not address these sections of the Public Utilities Code and was not presented with this factual scenario.
We therefore consider the duties and powers granted to the City by the Public Utilities Code to approve the Via Marina route. In the course of our analysis, we also consider a trial court’s duties and powers in reviewing the City’s decision. We start with our obligations as a Court of Appeal.
I. Standard of Review
Interpretation of a statute presents a question of law that we review de novo. (Carrancho v. California Air Resources Board (2003) 111 Cal.App.4th 1255, 1265 [4 Cal.Rptr.3d 536] (Carrancho).) In interpreting a statute, our primary duty “is to give effect to the intent of the Legislature, so as to effectuate the purpose of the law. [Citation.] To determine intent, courts turn first to the words themselves, giving them their ordinary and generally accepted meaning. [Citation.] If the language permits more than one reasonable interpretation, the court then looks to extrinsic aids, such as the object to be achieved and the evil to be remedied by the statute, the legislative history, public policy, and the statutory scheme of which the statute is a part. [Citation.] . . . Ultimately, the court must select the construction that comports most closely with the apparent intent of the Legislature, with a view to promoting rather than defeating the general purpose of the statute, and it must avoid an interpretation leading to absurd consequences. [Citation.]” (In re Luke W. (2001) 88 Cal.App.4th 650, 655 [105 Cal.Rptr.2d 905].)
“[T]he ‘plain meaning’ rule does not prohibit a court from determining whether the literal meaning of a statute comports with its purpose or whether such a construction of one provision is consistent with other provisions of the statute. The meaning of a statute may not be determined from a single word or sentence; the words must be construed in context, and provisions relating to the same subject matter must be harmonized to the extent possible. [Citation.] Literal construction should not prevail if it is contrary to the legislative intent apparent in the statute. The intent prevails over the letter, and the letter will, if possible, be so read as to conform to the spirit of the act. [Citations.]” (Lungren v. Deukmejian (1988) 45 Cal.3d 727, 735 [248 Cal.Rptr. 115, 755 P.2d 299].)
II. Statutory Framework
Given the above rules, we now turn to the language of the statute itself. The Public Utilities Code grants the City a right to construct a sewer *651line outside of its territorial limits within certain parameters. Section 10101 provides: “There is granted to every municipal corporation of the State the right to construct, operate, and maintain . . . sewers and sewer mains, all with the necessary appurtenances, across, along, in, under, over, or upon any road, street, alley, avenue, or highway, and across, under, or over any railway, canal, ditch, or flume which the route of such works intersects, crosses, or runs along, in such manner as to afford security for life and property.” Section 10102 requires a municipality to “restore the road, street, alley, avenue, highway, canal, ditch, or flume so used to its former state of usefulness as nearly as may be, and shall locate its use so as to interfere as little as possible with other existing uses of a road, street, alley, avenue, highway, canal, ditch, or flume.”
Before any municipality may locate its sewer lines outside its territorial limits, however, “it shall request the municipal corporation in which the street, alley, avenue, or highway is situated to agree with it upon the location of the use and the terms and conditions to which the use shall be subject.” (§ 10103.) “If the two municipal corporations are unable to agree on the terms and conditions and location of a use within three months after a proposal to do so, the municipal corporation proposing to use a street, alley, avenue, or highway may bring an action in the superior court of the county in which the street, alley, avenue, or highway is situated against the other municipal corporation to have the terms and conditions and location determined. The superior court may determine and adjudicate the terms and conditions to which the use of the street, avenue, alley, or highway shall be subject, and the location thereof, and upon the making of the final judgment the municipal corporation desiring to do so may enter and use the street, alley, avenue, or highway upon the terms and conditions and at the location specified in the judgment.” (§ 10104.)
Section 10105 provides an exception to the proscriptions outlined in sections 10103 and 10104: “A grant of authority from or agreement with another municipality is not necessary in any case where the street, alley, avenue, or highway, or portion thereof, proposed to be used is a necessary or convenient part of the route of the proposed works and at the time construction was commenced or the plans adopted was located in unincorporated territory.”
HI. Section 10105 Applies to Unincorporated Areas
The Public Utilities Code is clear—section 10101 grants to every municipality the right to construct utility lines “across, along, in, under, over, or upon any road, street, alley, avenue, or highway.” However, this general right is constrained by sections 10102 to 10105. Sections 10103, 10104 and *65210105, in particular, become operative if all or some of the project is located outside the municipality’s territorial limits. (City of L. A. v. City of Huntington Pk. (1939) 32 Cal.App.2d 253, 271 [89 P.2d 702].) A plain reading of these sections clearly shows the Legislature intended to differentiate between unincorporated territories, which are governed by counties, and territories falling within the governance of municipal corporations. Municipal corporations, such as the City, are created by its residents as a form of local government while counties are subdivisions of the state, which are created to exercise certain functions of the state government. (Otis v. City of Los Angeles (1942) 52 Cal.App.2d 605, 611 [126 P.2d 954].) Sections 10103 and 10104 expressly apply when a utility line extends over the territories of two municipal corporations; section 10105 applies when a utility line extends over unincorporated territory. The County is not a municipal corporation (Riley v. Stack (1932) 128 Cal.App. 480, 483 [18 P.2d 110]), and both parties agree that the portions of the Via Marina route at issue fall under unincorporated territory. Accordingly, only section 10105 applies in this case.
Nevertheless, the County argues that the requirements under sections 10103 and 10104 apply to unincorporated territories when the proposed project is not “necessary or convenient.” We disagree. There is no provision in section 10105 that requires a party to seek agreement or a judicial determination if the street to be used is not a “necessary or convenient part of the route of the proposed works.” Indeed, section 10105 expressly excuses a party from obtaining agreement. “When the words of a statute are clear, a court ‘should not add to or alter them to accomplish a purpose that does not appear on the face of the statute or from its legislative history.’ ” (Wilson v. Hidden Valley Mun. Water Dist. (1967) 256 Cal.App.2d 271, 283 [63 Cal.Rptr. 889], quoting Estate of Simmons (1966) 64 Cal.2d 217, 221 [49 Cal.Rptr. 369, 411 P.2d 97].)
Thus, section 10103 does not apply. Section 10104 is predicated on section 10103 and only becomes operative if two municipalities cannot reach agreement. Moreover, section 10104 makes no mention of unincorporated territory, applying only to territory controlled by a municipal corporation. It sets forth detailed procedures by which a trial court may determine the terms and conditions of the use of the other municipality’s street, none of which is contained in section 10105. “ ‘It is a settled rule of statutory construction that where a statute, with reference to one subject contains a given provision, the omission of such provision from a similar statute concerning a related subject is significant to show that a different legislative intent existed with reference to the different statutes.’ [Citation.]” (In re Jennings (2004) 34 Cal.4th 254, 273 [17 Cal.Rptr.3d 645, 95 P.3d 906].) Therefore, we do not interpret section 10105 to authorize a trial court to “determine and adjudicate the terms and conditions” of use of county property. (§ 10104.)
*653Despite our conclusion that judicial review under section 10104 does not apply in this case, we do not believe the City may completely avoid judicial review of its incursion into county territory. Certainly, section 10105 does not expressly excuse a judicial determination as it does a municipal corporation’s agreement. Further, allowing the City absolute discretion in this case ignores the rights of the residents of unincorporated areas. Such a rule would provide the City with unfettered power to construct utility lines outside its territorial limits despite objection. If there is a dispute over whether a proposed portion of the route is necessary or convenient, the courts are uniquely equipped to review the issue. “In general, judicial authority is exercised for the purpose of determining the rights or liabilities of parties according to law, with respect to transactions already had between them .... With some exceptions the judicial function is to find facts and apply rules of law thereto for the purpose of settling a dispute or contest between parties concerning their rights.” (Los Angeles v. City of South Gate (1930) 108 Cal.App. 398, 401 [291 P. 654].) Having reached this conclusion, we must consider the standard of review a trial court is to employ.
IV. The Trial Court’s Standard of Review Under Section 10105
A writ of mandate will lie to “compel the performance of an act which the law specially enjoins, as a duty resulting from an office, trust, or station” (Code Civ. Proc., § 1085, subd. (a)) “where there is not a plain, speedy, and adequate remedy, in the ordinary course of law.” (Code Civ. Proc., § 1086.) The writ will issue against a county, city or other public body or against a public officer. (Housing Authority v. City of L. A. (1952) 38 Cal.2d 853, 869-871 [243 P.2d 515]; Hawthorn v. City of Beverly Hills (1952) 111 Cal.App.2d 723, 731 [245 P.2d 352].) Code of Civil Procedure section 1085 permits judicial review of ministerial duties as well as quasi-legislative and legislative acts. (County of Del Norte v. City of Crescent City (1999) 71 Cal.App.4th 965, 972 [84 Cal.Rptr.2d 179].) A trial court must determine whether the agency had a ministerial duty capable of direct enforcement or a quasi-legislative duty entitled to a considerable degree of deference. This question is generally subject to de novo review because it is one of statutory interpretation, a question of law for the trial court. (Ibid.; Carrancho, supra, 111 Cal.App.4th at p. 1266; City of Chula Vista v. Superior Court (1982) 133 Cal.App.3d 472, 486 [183 Cal.Rptr. 909] (Chula Vista).)
A ministerial duty is one which is required by statute. “A ministerial act is an act that a public officer is required to perform in a prescribed manner in obedience to the mandate of legal authority and without regard to his own judgment or opinion concerning such act’s propriety or impropriety, when a given state of facts exists. Discretion, on the other hand, is the power conferred on public functionaries to act officially according to the dictates of *654their own judgment.” (Rodriguez v. Solis (1991) 1 Cal.App.4th 495, 501-502 [2 Cal.Rptr.2d 50]; see Transdyn/Cresci JV v. City and County of San Francisco (1999) 72 Cal.App.4th 746, 752 [85 Cal.Rptr.2d 512].)
Normally, mandate will not lie to control a public agency’s discretion, that is to say, force the exercise of discretion in a particular manner. However, it will lie to correct abuses of discretion. (Manjares v. Newton (1966) 64 Cal.2d 365, 370 [49 Cal.Rptr. 805, 411 P.2d 901].) In determining whether a public agency has abused its discretion, the court may not substitute its judgment for that of the agency, and if reasonable minds may disagree as to the wisdom of the agency’s action, its determination must be upheld. (Id. at pp. 370-371.) A court must ask whether the public agency’s action was arbitrary, capricious, or entirely lacking in evidentiary support, or whether the agency failed to follow the procedure and give the notices the law requires. (Los Angeles Lincoln Place Investors, Ltd. v. City of Los Angeles (1997) 54 Cal.App.4th 53, 59 [62 Cal.Rptr.2d 600].)
In applying this extremely deferential test, a court “ ‘must ensure that an agency has adequately considered all relevant factors, and has demonstrated a rational connection between those factors, the choice made, and the purposes of the enabling statute.’ ” (Western States Petroleum Assn. v. Superior Court (1995) 9 Cal.4th 559, 577 [38 Cal.Rptr.2d 139, 888 P.2d 1268], quoting California Hotel & Motel Assn. v. Industrial Welfare Com. (1979) 25 Cal.3d 200, 212 [157 Cal.Rptr. 840, 599 P.2d 31].) Deferential review of quasi-legislative activity minimizes judicial interference in the interests of the separation of powers doctrine. (Chula Vista, supra, 133 Cal.App.3d 472, 485.)
The conduct which is to be reviewed in this case involves considerable discretion on the part of the City and is a quasi-legislative act that may be reviewed pursuant to a traditional writ of mandate. (See Wilson v. Hidden Valley Mun. Water Dist., supra, 256 Cal.App.2d at p. 283.) The Public Utilities Code endows a municipality with the power to locate its sewer lines on any street, subject only to a determination that the street is “a necessary or convenient part of the route of the proposed works” if it is located in unincorporated territory. (§§ 10101, 10105.) The City’s approval of the Via Marina route involved “balancing various factors and selecting among various approaches to the same problem,” all hallmarks of discretionary acts. (Venice Town Council, Inc. v. City of Los Angeles (1996) 47 Cal.App.4th 1547, 1562 [55 Cal.Rptr.2d 465].) Thus, judicial review is limited to a determination of whether the City’s adoption of the Via Marina route was arbitrary, capricious, or entirely lacking in evidentiary support. (Carrancho, supra, 111 Cal.App.4th at p. 1269.)
*655Here, the trial court failed to apply the correct standard of review. It held that “in order to be relieved of a grant of authority, or agreement, under the sections of the Public Utilities Code, the City must show by preponderance of evidence, that the Via Marina route is necessary or convenient. The CEQA [environmental impact report] demonstrates that the route is not ‘necessary’ because it describes an alternative. Therefore, the City must prove not just that the route is ‘suitable’ but that it is more convenient than the Pacific Ave. alignment. As discussed above, the court is not persuaded the Via Marina route is so superior as to justify the extraterritorial incursion encompassed by section 10105 of the Public Utilities Code.” Rather than defer to the City’s discretion, the trial court conducted an independent review of the evidence and reached its own conclusions regarding what was necessary or convenient.
DISPOSITION
The judgment is reversed and the matter is remanded for it to apply section 10105 under the more deferential standard of review as discussed above. The City is to recover its costs on appeal.
Rubin, J., and Grimes, J., concurred.
Respondent’s petition for review by the Supreme Court was denied June 12, 2013, S210152.
All further section references are to the Public Utilities Code unless otherwise specified.