
144 Cal.App.2d 735 (1956)
NORWOOD S. TRONSLIN, Appellant,
v.
CITY OF SONORA, Respondent.
Civ. No. 8797. 
California Court of Appeals. Third Dist.  
Sept. 28, 1956.
 Ross A. Carkeet for Appellant.
 William C. Coffill, City Attorney, for Respondent. *736
 PEEK, J.
 On April 18, 1936, plaintiff's predecessor in interest granted to the defendant city a right-of-way through grantor's land for a distance of approximately 1,800 feet for the purpose of installing the main sewer line to defendant's primary treatment plant. Among other things, the agreement provided that as a part of the consideration for the granting of the right- of-way, the city would construct, at its expense, two "Y" branches, one near the grantor's home and the other at whatever point on his property he might select, each branch to be sufficient in size to service as many dwellings as could reasonably be expected to be built upon the premises. At the time of the execution of the agreement it was the practice of the city to charge the one sum of $50 for any sewer connection made outside of the city limits. Subsequently this charge was progressively raised until it reached the sum of $300 per connection. During this same period, however, no monthly or other periodical charge was made by the city for use of the system.
 Approximately five years after the right-of-way agreement was executed, a dispute arose between plaintiff and defendant concerning the provisions of said agreement, and plaintiff filed an action seeking a declaration of the rights and obligations of the parties thereunder. At the conclusion of the hearing upon the issues so raised, the court specifically found that in consideration of the grant of right-of-way, the city was to install two connections of sufficient size as necessary to care adequately for such amount of sewage as might reasonably be expected to result from such number of houses or dwelling quarters as might reasonably be built "within a reasonable service area." The court then concluded that by virtue of the right-of-way agreement, the grantor became entitled to the "use" of two "Y" connections "for the purpose of disposing of the sewage which might reasonably be expected to result from" the houses that might reasonably be built on the land, "said sewage to flow into the city main sewer line" through said connections. [1a] The judgment which was thereafter entered followed generally the findings and conclusions and held that "the right of plaintiff to make such connections and service such number of dwellings through each of said two six-inch 'Y' connections" was "independent of and free and clear of any costs, charges, taxes, or license fees levied by the resolutions, laws or ordinances of said defendant City of Sonora, a Municipal Corporation, for the connection of sewer lines from dwelling houses lying outside *737 the corporate limits of the said City of Sonora, a municipal corporation, to the sewage disposal system of said defendant city; and subject only to the requirement that no lateral line shall be connected to either of said two six-inch 'Y' connections ..." except upon notice in writing to the clerk of said city.
 Thereafter plaintiff installed lateral lines and connected the same to the defendant's main line in accordance with the agreement as found by the court. Although numerous houses were thereafter built in said area and so connected, no charges were made or collected by the defendant for the use of said system from August 26, 1941, the date the judgment was entered, until June 15, 1953. On that date, by resolution, the defendant city adopted an ordinance wherein it was provided that an annual charge of $24 would be levied against each user occupying a one-family dwelling outside of its corporate limits. Plaintiff thereupon filed his present action for an injunction, and from the judgment which was thereafter entered in favor of defendant he now appeals.
 Plaintiff, in his attack upon the judgment, contends that a valid contract was entered into between the defendant city and his predecessor in interest by which the one granted a right-of-way across his lands in consideration of the right to connect with and use the system, and that the judgment in the prior action was a complete adjudication of such rights and obligations of the parties under the contract. In answer to plaintiff's contention, defendant first relies upon the rule that the building and maintenance of a sewage system by a political body is an exercise of its police power which cannot be bartered away, and second that in any event it was only the right to connect with the system as distinguished from the right to use the system that was adjudicated in the prior proceeding, and hence the city was free to levy the service charge as it did.
 While in the abstract it may be said that defendant's first argument is a proper generalization of the rule, nevertheless we find no such question involved in the present proceeding. Although the installation of the sewage system was quite obviously an exercise of the police power of the defendant city for the public health and welfare of its residents, that is not to say that it was a like proceeding for the benefit of those persons residing outside of its corporate limits. Paraphrasing what we said in Hobby v. City of Sonora, 142 *738 Cal.App.2d 457 [298 P.2d 578], neither plaintiffs nor all other residents of Tuolumne County constitute a class amenable to any ordinance passed by the Sonora City Council. The defendant city could no more compel plaintiff here, as a resident of the county, to connect with the sewer than could plaintiff compel the city to extend its lines into county territory and allow county residents to connect therewith. The system is wholly owned by one political subdivision, the city of Sonora; the plaintiff is a resident of another, the county of Tuolumne. The right-of-way across plaintiff's land could only have been acquired in one of two ways--either by condemnation or by contract. In the present case it may have been that the city, in lieu of condemnation of the property of plaintiff and payment to him of the damages which necessarily would have flowed therefrom, or for one of many other reasons, decided in its discretion to escape what might have been a long and costly proceeding and to accomplish the same purpose by an agreement, i.e., that for the right to possess and use a way across plaintiff's land for the construction and maintenance of its sewer, it would give to plaintiff the right to connect with and to use the sewer. Its act in so doing could in no sense be said to have been an invalid exercise of its power to contract. [2] And having entered into a valid contract, it could not, by ordinance, impair the same. (City of Los Angeles v. Los Angeles City Water Co., 61 Cal. 65.)
 Our conclusion as to the first contention necessarily points up defendant's second contention; that is, even if the contract was valid it only contemplated the right to connect with the system--not to the use of the system for the flowage of sewage therein; that such was the conclusion of the trial court in the prior case, and hence the defendant city could validly levy the charge here in question. The uncertainty, if it be such, in the present case would appear to stem from use of the word "connect" in the judgment in the prior action. However reference to what we have heretofore quoted from that proceeding would appear to dispel that uncertainty. [3] Furthermore, the rule is well established that "... every judgment must be construed with relation to the particular matter before the court for adjudication" (Newport v. Superior Court, 192 Cal. 92, 94 [230 P. 168].) [4] It is the further rule that when a question of interpretation of a judgment has arisen, reference may be had to the whole record. (28 Cal.Jur.2d,  77, p. 713.) Here the court found *739 that plaintiff was entitled to connect with the system and concluded this meant the use of the two "Y" connections for the disposal of sewage which could reasonably be expected from the building of the houses contemplated, and the judgment declared that the right so granted by the easement was "free and clear of any costs, charges, taxes, or license fees, levied by the resolutions, laws or ordinances" of the defendant city.
 [1b] Necessarily, therefore, since the contract was a valid exercise of the city's right of contract to provide adequate sewage facilities for its residents; and since the city could not impair its valid contract by ordinance (61 Cal. 65); and further since the rights of the parties to that contract were previously adjudicated by a judgment long since become final, this court is bound by the determination made therein.
 The judgment is reversed, and the cause is remanded with instructions to enter judgment in favor of plaintiff as prayed.
 Van Dyke, P. J., and Schottky, J., concurred.
