
595 N.W.2d 551 (1999)
257 Neb. 189
STATE of Nebraska ex rel. CITY OF ALMA, a Nebraska municipal corporation, Appellee,
v.
FURNAS COUNTY FARMS, a general partnership, et al., Appellants.
No. S-98-211.
Supreme Court of Nebraska.
July 2, 1999.
*553 Noyes W. Rogers, Columbus, for appellant.
Denzel R. Busick, of Luebs, Leininger, Smith, Busick, Johnson, Baack, Placzek & Steele, Grand Island, for appellee.
HENDRY, C.J., WRIGHT, GERRARD, STEPHAN, McCORMACK, and MILLER-LERMAN, JJ., and HANNON, Judge.
STEPHAN, J.

INTRODUCTION
In this action, the City of Alma sought a writ of mandamus, requiring respondents to comply with certain ordinances pertaining to the construction of new solid and liquid waste storage facilities, and a declaratory judgment with respect to the validity and applicability of those ordinances. The district court for Harlan County entered a peremptory writ of mandamus from which this appeal was taken. We conclude that the entry of the writ was error and therefore reverse and vacate, and remand for further proceedings.

FACTUAL AND PROCEDURAL BACKGROUND
The City of Alma (City), organized and existing as a city of the second class pursuant to Neb.Rev.Stat. § 17-101 et seq. (Reissue 1997), filed a verified petition on November 5, 1997, seeking a writ of mandamus pursuant to Neb.Rev.Stat. § 25-2156 (Reissue 1995) and a declaratory judgment pursuant to Neb.Rev.Stat. § 25-21,150 (Reissue 1995). It named as respondents Furnas County Farms (FCF), a general partnership; Sand Livestock Systems, Inc. (SLS), a corporation; Charles W. Sand, Jr.; and Timothy A. Cumberland. Sand and Cumberland are alleged to be general partners of FCF as well as corporate officers of SLS. The City alleged that FCF was the record title owner of a 125-acre tract of land located in Harlan County approximately 8 miles from the Alma city limits and that SLS has or claims an ownership interest and easement in this property. The City alleged that FCF and SLS intended to build and operate a "large hog confinement facility" on this property for the purpose of penning, feeding, and finishing a constant capacity of 30,000 to 36,000 head of feeder pigs for market. The City further alleged that this proposed facility would involve excavation of three waste disposal lagoons, each 24 feet deep, and together having a surface area of approximately 26 acres, which would "hold a total of approximately 145 million gallons of liquidized hog manure on a continuing, on-going, and daily basis." According to the City's allegations, *554 current data show the surface and subsurface drainage to and from the lagoons, without adequate and proper controls, has a high potential of polluting, injuring, and contaminating ground water which supplies Relator's public drinking water wells, within three to five years, perhaps sooner, creating a significant endangerment to public health.
The City alleged that pursuant to the authority conferred upon it by Neb.Rev. Stat. § 17-536 (Reissue 1997), it enacted ordinances which require any person or entity seeking to construct or operate any manufacturing, livestock, or other facility within 15 miles of its city limits "which will create liquid or solid liquid waste to be stored or disposed of into holding ponds, lagoons, tanks, or other containers, or which will be discharged into waterways or onto or under the soil" to first apply for and obtain a permit from the City. The ordinances include certain design, construction, and monitoring requirements for such facilities, in addition to those imposed by the Nebraska Department of Environmental Quality (NDEQ), with which an applicant must comply in order to obtain a permit.
The City alleged that respondents, claiming that the ordinances were invalid, commenced construction of the hog confinement facility without obtaining the permit which the ordinances require. It further alleged:
Respondents Furnas County Farms and Sand Livestock Systems, Inc.,are proper subjects to be compelled to perform mandatory duties by means of a writ of mandamus by virtue of their legal status and station as legal entities created by the law of the state of Nebraska, and the obligations specifically enjoined upon them by Relator's ... ordinances. Respondent Furnas County Farms, as a Nebraska general partnership, and Respondent Sand Livestock Systems, Inc., as a Nebraska corporation, are required to transact only lawful business in ... Nebraska. [Citations omitted.] Respondents Charles W. Sand, Jr., and Timothy A. Cumberland are proper parties to be named herein so as to physically receive any writ of mandamus which may be issued herein to Respondent Furnas County Farms because they are the general partners of said partnership, and directly responsible for its activities. Respondent Charles W. Sand, Jr., is also a proper party to be named herein to physically receive any writ of mandamus which maybe issue [sic] herein to Respondent Sand Livestock Systems, Inc., because he is president of the corporation, and directly responsible for its day-to-day activities.
The City alleged that the subject ordinances were enacted in order to protect its water supply from pollution and contamination and that
[a] law action for damages is not adequate to protect the ultimate health, welfare, and safety of the public, and will not ensure that the Respondent's [sic] will construct the proposed hog confinement facility in a manner which will prevent pollution of the Relator's water supply in the first instance, nor remove pollution therefrom in the second instance. Accordingly, Relator and the public it represents will suffer irreparable harm for which they have no adequate remedy at law which will timely compel Respondent's compliance with the mandatory obligations of Relator's lawful ordinances for the benefit of the public's health, welfare, and safety.
The City prayed for a writ of mandamus requiring respondents to comply with the ordinances "or, alternatively, to appear and show cause, if any there be, as to why they refuse to comply...." In addition, the City prayed for a judgment declaring the ordinances in question "to be within its statutory and lawful powers" and "valid and binding upon Respondents."
An alternative writ of mandamus directed to respondents was filed on November 5, 1997, the same date on which the petition was filed. The alternative writ recited *555 that the City had "made a prima facie showing that its water supply and the public's health, welfare, and safety may be jeopardized by the failure of Respondents to comply with said ordinances, and an action at law for damages may not be an adequate remedy." The alternative writ further provided that FCF and SLS were "mandated by Nebraska law to act in a lawful manner" and required them "to comply with all valid laws, ordinances, and regulations of the State of Nebraska and its subdivisions," including compliance with the City's ordinances applicable to the construction of hog confinement facilities. Individual respondents were required by the alternative writ to cause FCF and SLS to comply with its terms. The alternative writ further required that any respondent failing or refusing to comply with its directive appear and show cause at a hearing scheduled for November 19,1997.
Three responsive pleadings were filed on the day prior to the hearing. FCF filed an answer and cross-petition in which it alleged that the ordinances at issue were passed and adopted after its acquisition of the proposed hog confinement facility site "for the sole purpose of stopping or hindering the completion" of the facility. FCF alleged that it had undertaken studies to determine that the facility met with all regulations and laws of the State of Nebraska as promulgated by NDEQ and further, that the facility would not cause pollution or injury to the City's water supply. It further alleged that the subject ordinances constitute local or special laws, in violation of article III, § 18, of the Nebraska Constitution; that they deprive FCF of constructing a hog confinement facility on its land in violation of due process guarantees of the state and federal Constitutions; that the ordinances are not reasonably necessary to prevent pollution or injury to the City's water supply, but, rather, are calculated to make the construction of the facility unreasonably expensive and burdensome; and that the ordinances are preempted by Neb.Rev. Stat. § 81-1504(11) (Cum.Supp. 1996), granting NDEQ the power to issue permits for the discharge of wastes into air, land, and water. In its cross-petition, FCF sought damages for a delay in construction of the hog confinement facility attributable to "the invalid ordinances adopted by the City of Alma and the attempt to force compliance of same." The City moved to strike the cross-petition on the ground that it was not a permissible pleading in an action for mandamus pursuant to Neb.Rev.Stat. § 25-2164 (Reissue 1995). SLS filed an answer consisting of a general denial and a specific denial of "any interest in any of the real estate described in Relator's Petition, either through fee ownership or easements." Sand and Cumberland filed a general demurrer.
During the hearing on November 19, 1997, the district court heard argument on the City's motion to strike the cross-petition, the demurrer of Sand and Cumberland, and the directive to show cause set forth in the alternative writ. An attorney employed by SLS testified that SLS had commenced construction of the confinement facility pursuant to a contract with FCF, but had ceased construction activity when it learned of the filing of this action. She further testified that construction was 6 to 8 months from completion when it was halted. The district court took all matters argued at the hearing under advisement pending the submission of briefs.
On December 3, 1997, prior to any decision by the district court on the matters under advisement, FCF filed a motion for leave to submit "as further showing of cause why a Writ of Mandamus should not [be] issue[d]" a permit issued by NDEQ and received by FCF on December 1, 1997, purportedly authorizing construction of the waste lagoons for the confinement facility. The City filed a written objection on the grounds that FCF should have moved for a continuance of the show cause hearing and that the permit was irrelevant.
*556 On February 23, 1998, the district court entered a peremptory writ of mandamus commanding respondents to comply with the requirements of the subject ordinances. In its writ, the court sustained the motion to strike the cross-petition as contrary to § 25-2164 and overruled the motion to allow an additional showing. In addition, the court found that enactment of the ordinances at issue were within the City's statutory authority, that the ordinances were valid, and that "the respondents are required to apply for a permit through the City of Alma as specified in its ordinances." The court further determined that it was "not required in this order to rule on the constitutionality or reasonableness of relators [sic] ordinances and declines to do so." Respondents perfected an appeal from the peremptory writ and filed a "Notice of Constitutional Questions" pursuant to Neb. Ct. R. of Prac. 9E (rev.1996) as well as a petition to bypass, which we granted. Although the notice of appeal was filed on behalf of all four original respondents, only FCF filed a brief in this court.

ASSIGNMENTS OF ERROR
FCF contends, restated and renumbered, that the district court erred in (1) issuing a peremptory writ of mandamus without conducting a trial on the issues raised in its answer, (2) not determining that the ordinances in question were unconstitutional, and (3) refusing to receive evidence of the permit issued by NDEQ.

STANDARD OF REVIEW
An action for a writ of mandamus is a law action, and in an appellate review of a bench trial of a law action, a trial court's factual findings have the effect of a jury verdict and will not be set aside unless clearly erroneous. State ex. rel. Neb. Health Care Assn. v. Dept. of Health, 255 Neb. 784, 587 N.W.2d 100 (1998). When reviewing a question of law, an appellate court reaches a conclusion independent of the lower court's ruling. Teters v. Scottsbluff Public Schools, 256 Neb. 645, 592 N.W.2d 155 (1999).

ANALYSIS
In addressing FCF's first assignment of error, we must initially determine whether mandamus is an appropriate remedy in this case. We note that in its brief, FCF states that it "did not challenge the applicability of a mandamus action to a totally private partnership (which is highly questionable)" because it desired a determination of the constitutionality of the ordinances. Brief for appellant at 29. This strategy on the part of FCF does not restrict our obligation to analyze the issue before us in accordance with stablished principles of law. An appellate court will not pass on the constitutionality of legislation absent a need to do so in order to properly dispose of an action. State ex rel. Wieland v. Beermann, 246 Neb. 808, 523 N.W.2d 518 (1994).
Mandamus is an action at law and is an extraordinary remedy issued to compel performance of a purely ministerial act or duty imposed by law upon an inferior tribunal, corporation, board, or person, where (1) the relator has a clear legal right to the relief sought, (2) there is a corresponding clear duty existing on the part of the respondent to perform the act in question, and (3) there is no other plain and adequate remedy available in the ordinary course of the law. State ex rel. Acme Rug Cleaner v. Likes, 256 Neb. 34, 588 N.W.2d 783 (1999); State ex rel. Fick v. Miller, 255 Neb. 387, 584 N.W.2d 809 (1998). A duty imposed by law which may be enforced by writ of mandamus must be one "which the law specifically enjoins as a duty resulting from an office, trust or station." (Emphasis supplied.) § 25-2156. In applying this statutory language, we have characterized mandamus as a means of compelling acts by "public officers." State, ex rel. Cashman, v. Carmean, 138 Neb. 819, 295 N.W. 801 (1941). Mandamus is available to enforce the performance of ministerial duties of a public official but is not available *557 if the duties are quasi-judicial or discretionary. Pratt v. Nebraska Bd. of Parole, 252 Neb. 906, 567 N.W.2d 183 (1997).
The record in the present case discloses no duty on the part of respondents traceable to any "office, trust or station." In arguing that respondents were not entitled to raise the issue of constitutionality, the City states in its brief, "Respondents ... are not public `ministerial officers' who have sworn an oath to uphold the Constitution." Brief for appellee at 15. In the same vein, the City argues that "Respondents, not being public officers, but instead private citizens upon whom a mandatory duty to apply for a permit devolves, irrespective of their view of the constitutionality thereof, must obey the law." Id. at 18. Thus, the duty which the City seeks to enforce by writ of mandamus is that duty which a private landowner would have in complying with ordinances placing restrictions on a specific use of property. This duty does not result from any "office, trust or station" as required by § 25-2156. While it is true that a compliance with a municipal ordinance may inure to the benefit of the general public, it does not follow that such compliance on the part of private persons or entities is a ministerial duty enforceable by the extraordinary remedy of mandamus.
As counsel acknowledged during oral argument, the relief sought in this case is in the nature of an injunction. The City is attempting to prevent FCF from constructing the waste lagoons necessary for its proposed hog confinement facility without first obtaining a permit from the City as required by its ordinance. The City's position is analogous to the interest of a licensing authority in preventing an individual from engaging in a particular profession without first obtaining the necessary license as prescribed by law. We have held that statutes requiring the licensing of certain professionals serve the purpose of protecting public rights, property, and welfare, and that the remedy of injunction is an appropriate means of preventing one who has not obtained a license from engaging in a profession in which licensure is required. State ex rel. Dept. of Health v. Jeffrey, 247 Neb. 100, 525 N.W.2d 193 (1994). Where injunctive relief may be sought, mandamus is not an available remedy. State ex rel. Krieger v. Board of Supervisors, 171 Neb. 117, 105 N.W.2d 721 (1960). See, also, Neb.Rev. Stat. § 25-2157 (Reissue 1995).
In the present case, the City could have sought an injunction to prevent FCF from constructing the waste lagoons without first obtaining a permit as required by its ordinances. It also could and did seek a declaratory judgment to determine the validity of its ordinances and their applicability to respondents. Therefore, the City had a "plain and adequate remedy in the ordinary course of the law" which, pursuant to § 25-2157, precluded issuance of a writ of mandamus.
Because there has been no trial on the City's request for declaratory relief, which will necessarily involve consideration of the defenses asserted in the answer of FCF, we remand the cause to the district court for that purpose and do not reach the remaining assignments of error.

CONCLUSION
We conclude that mandamus does not lie in this case because the act which the City sought to compel was not one which the law specifically enjoins as a duty resulting from an office, trust, or station, and because the City had a plain and adequate remedy in the ordinary course of the law, namely, a request for injunctive and declaratory relief. We therefore reverse and vacate the peremptory writ of mandamus and remand the cause for further proceedings with respect to the City's request for declaratory relief.
REVERSED AND VACATED, AND CAUSE REMANDED FOR FURTHER PROCEEDINGS.
CONNOLLY, J., not participating.
