
168 S.E.2d 389 (1969)
275 N.C. 454
CITY OF RALEIGH
v.
NORFOLK SOUTHERN RAILWAY COMPANY.
No. 31.
Supreme Court of North Carolina.
July 11, 1969.
*391 Donald L. Smith, Raleigh, for plaintiff City of Raleigh.
R. N. Simms, Jr., Raleigh, for defendant Ry. Co.
Joyner, Moore & Howison, Raleigh, for Southern Ry. Co., Maupin, Taylor & Ellis, Raleigh, for Seaboard Coast Line R., Co., amici curiae.
BRANCH, Justice.
The decision of the Court of Appeals is based on the principles set forth in City of Winston-Salem v. Southern Ry., 248 N.C. 637, 105 S.E.2d 37.
The majority view in this country recognizes that an ordinance in the interest of public safety, convenience or welfare which requires a railroad to construct or reconstruct, at its expense, passageways over or under streets and highways, without regard to which was first in existence, is a reasonable exercise of the police power. Atchison, T. & S. F. Ry. v. Public Utilities Commission, 346 U.S. 346, 74 S.Ct. 92, 98 L.Ed. 51; Erie R.R. v. Board of Public Utilities Commissioners, 254 U.S. 394, 41 S.Ct. 169, 65 L.Ed. 322; Chicago, Mil. & St. P. Ry. v. Minneapolis, 232 U.S. 430, 34 S.Ct. 400, 58 L.Ed. 671. See also Atlantic Coast Line R.R. v. Goldsboro, 155 N.C. 356, 71 S.E. 514, aff'd, 232 U.S. 548, 34 S.Ct. 364, 58 L.Ed. 721.
The rationale of these cases is that the public has a superior right to the safe and unimpeded use of streets and highways and since the railroad has obstructed such use, the cost to the railroad is damnum absque injuria. Missouri Pac. Ry. v. Omaha, 235 U.S. 121, 35 S.Ct. 82, 59 L.Ed. 157.
*392 In the case of City of Winston-Salem v. Southern Ry., supra, the city's charter provided that the city could require any railroad company, at its own expense, to construct, maintain and repair crossings at grade, over or under its streets. The governing body of the city enacted an ordinance requiring the defendant railroad to rebuild at its entire expense an existing trestle over a city street in order to accommodate increased traffic which would be caused by a proposed city thoroughfare. The city sought a writ of mandamus to enforce the ordinance. The defendant railroad challenged both the ordinance and the charter provision under which it was enacted as being arbitrary, unreasonable and unconstitutional. The defendant railroad introduced evidence of special facts which tended to show that railroads were in a losing competitive fight with other modes of transportation and could no longer effectively pass on costs of improvement and building to the public by rate increases; that benefit from overpass or underpass construction or improvement accrued to their strongest competitors, motor transports; that the municipality received large amounts for street improvement from gasoline taxes and ad valorem taxes on motor vehicles; that there was a strong legislative trend towards relieving railroads from payment of costs for overpass and underpass construction.
The trial court granted mandamus. The Supreme Court reversed the trial court, holding that the ordinance and the charter provisions were unconstitutional as applied to the facts of the case, in that it was an unreasonable exercise of the police power, depriving the defendant of its constitutional right of due process. The Court in so deciding said:
(T)he police power is subject to all the constitutional limitations which protect basic property rights, and therefore must be exercised at all times in subordination to Federal and State constitutional limitations and guarantees. Clinard v. Winston-Salem, 217 N.C. 119, 6 S.E.2d 867, 126 A.L.R. 634; Brewer v. Valk, supra, 204 N.C. 186, 167 S.E. 638; Clinton v. Oil Co., 193 N.C. 432, 137 S.E. 183, 55 A.L.R. 252; State v. Whitlock, 149 N.C. 542, 63 S.E. 123; State v. Williams, 146 N.C. 618, 61 S.E. 61, 17 L.R.A.,N.S., 299.
* * * * * *
* * * (W)hat was at one time regarded as an improper exercise of the police power may now, because of changed conditions, be recognized as a legitimate exercise of that power. Elizabeth City v. Aydlett, 201 N.C. 602, 161 S.E. 78; Miller v. Board of Public Works, supra [195 Cal. 477, 234 P. 381, 38 A.L.R. 1479]; 11 Am.Jur., Constitutional Law, Sec. 253. Similarly, a police regulation or measure, although valid when promulgated, may become unreasonable and confiscatory in operation as a result of later events or changed conditions. Nashville C. & St. L.R. Co. v. Walters, supra [294] U.S. 405, 55 S.Ct. 486, 79 L.Ed. 949].
* * * * * *
Upon consideration of these special facts and all the surrounding circumstances of the case, we conclude that the ordinance of the City of Winston-Salem requiring the defendant railway company to pay the entire expense of rebuilding the trestle amounts to an unreasonable exercise of the police power, amounting to an invasion of the company's property rights in violation of the constitutional guarantee provided by the "law of the land" or "due process" section of the Constitution of North Carolina. Article I, Section 17. (Emphasis ours.)
See Nashville, C. & St. L. Ry. v. Walters, 294 U.S. 405, 55 S.Ct. 486, 79 L.Ed. 949.
The case of Winston-Salem v. Southern Ry., supra, applies well-recognized constitutional principles and, without overruling the majority view, reaches its conclusions by factual distinctions based principally on absence of the elements of public safety and danger to the public. It is important *393 to note that in that case the Court concluded that the ordinance requiring the defendant to pay "the entire expense of rebuilding the trestle amounts to an unreasonable exercise of the police power, amounting to an invasion of the company's property rights in violation of the constitutional guarantee provided by the `law of the land' or `due process' section of the Constitution of North Carolina, Article I, Section 17." (Emphasis ours.)
Our courts are thus confronted with the enigma of what portion of the costs may be allocated to the railroad by the city without constituting the exercise of its police power unreasonable and arbitrary. Clearly, the proper forum for relief is the legislative. The Legislature has enacted statutes authorizing the Highway Commission to allocate the costs in eliminating or safeguarding grade crossings, underpasses, or overpasses, where any road or street forming a part of the State Highway System is concerned (N.C.Gen.Stat. § 136-20(b)) and has further authorized the Utilities Commission to require the raising or lowering of any tracks or roadways at any grade crossing in a road or street not forming a link in or part of the State Highway System (N.C.Gen.Stat. § 62-223) and to allocate the costs thereof. The statutory formula for allocation of the costs provides "that the cost of construction of such underpass or overpass or the installation of such safety device shall be allocated between the railroad company and the Commission in the same ratio as the net benefits received by such railroad company from the project bear to the net benefits accruing to the public using the highway, and in no case shall the net benefits to any railroad company or companies be deemed to be more than ten per cent (10%) of the total benefits resulting from the project." N.C.Gen. Stat. § 136-20(b).
This legislative trend is further indicated by the Federal Highways Act of 1958, 23 U.S.C. § 130 (1964), under which railroads are required to pay for overpasses or underpasses where federal money goes into the projects only in proportion to the benefits received, and in no case are the railroads required to pay in excess of ten per cent of the cost incurred.
At least one jurisdiction has recognized legislative enactments as creating state policy limiting the municipality's general police power. City of Memphis v. Southern Ry., 167 Tenn. 181, 67 S.W.2d 552.
Whether the same formula and limitations should apply where municipal streets are concerned is a matter for the Legislature. We do not consider it to be the province of the courts to allocate the cost between the municipality and the railroad. Where the municipality, pursuant to its police power, seeks to compel a railroad to reconstruct a trestle at its full or partial expense, the allocation of the cost is a part of its legislative function. When an ordinance exercising the municipal police power is properly before the court so as to prevent a justiciable controversy, it is the province of the court to determine whether the police power has been exercised within constitutional limits. State v. Whitaker, 228 N.C. 352, 45 S.E.2d 860. In making this decision the allocation of the cost is a special factor to be considered by the court in determining the validity of the exercise of the police power.
The lack of guidelines or standards for the allocation of costs in cases of this nature creates an uncertain and uncharted area in the exercise of municipal police power. This unsatisfactory condition does not, however, warrant the court's intrusion into the legislative area in violation of Article I, Section 8, of the North Carolina Constitution.
We turn to the determinative question of whether a justiciable controversy is here presented.
The police power vests in the individual states, and in the exercise thereof the legislature may enact laws, within constitutional limits, to protect or promote the health, morals, order, safety, and general *394 welfare of society. State v. Ballance, 229 N.C. 764, 51 S.E.2d 731, 7 A.L.R.2d 407; State v. Whitaker, supra. The General Assembly may delegate to a municipality, as an agency of the State, authority to enact ordinances in the exercise of the police power. State v. Scoggin, 236 N.C. 1, 72 S.E.2d 97. However, the municipality has only such powers as are delegated to it, and such powers are, of course, subject to the same constitutional limitations as are police powers exercised directly by the State. Winston-Salem v. Southern Ry., supra. In reviewing the exercise of the police power, it is the sole duty of the court to ascertain whether the act violates any constitutional limitation, the question of public policy being solely within the province of the legislature. State v. Whitaker, supra. Generally, the police power can only be exercised by a body possessing legislative power, 16 C.J.S. Constitutional Law § 177 (1956), and it is generally accepted that the police powers of a municipality are to be carried into effect and discharged through provisions of ordinances or resolutions enacted by the Council or other governing authority at a meeting legally called. 37 Am.Jur. Municipal Corporations § 52 (1941); 2 McQuillin, Municipal Corporations § 10.30, at 816 (3d ed.1966 rev. vol.)
The Uniform Declaratory Judgment Act, codified as N.C.Gen.Stat. § 1-253 et seq., furnishes a proper method for determining all controversies relative to the construction and validity of a statute. Woodard v. Carteret County, 270 N.C. 55, 153 S.E.2d 809.
N.C.Gen.Stat. § 1-254 states:
Any person interested under a deed, will, written contract or other writings constituting a contract, or whose rights, status or other legal relations are affected by a statute, municipal ordinance, contract or franchise, may have determined any question of construction or validity arising under the instrument, statute, ordinance, contract, or franchise, and obtain a declaration of rights, status, or other legal relations thereunder. A contract may be construed either before or after there has been a breach thereof.
In the case of Angell v. City of Raleigh, 267 N.C. 387, 148 S.E.2d 233, citizens and taxpayers of the City of Raleigh instituted a proceeding under the Declaratory Judgment Act to determine the validity of an ordinance authorizing the City to grant licenses for installation and operation of a community antenna television system. No licenses had been issued by the City. The trial court held the ordinance valid. This Court held that no justiciable controversy existed, and in part stated:
In the case of Lide v. Mears, 231 N.C. 111, 56 S.E.2d 404, Ervin, J., speaking for the Court, said:
"There is much misunderstanding as to the object and scope of this legislation (the Uniform Declaratory Judgment Act). Despite some notions to the contrary, it does not undertake to convert judicial tribunals into counsellors and impose upon them the duty of giving advisory opinions to any parties who may come into court and ask for either academic enlightenment or practical guidance concerning their legal affairs. Town of Tryon v. Power Co., 222 N.C. 200, 22 S.E.2d 450; Allison v. Sharp, 209 N.C. 477, 184 S.E. 27; Poore v. Poore, 201 N.C. 791, 161 S.E. 532; Anderson on Declaratory Judgments, section 13. This observation may be stated in the vernacular in this wise: The Uniform Declaratory Judgment Act does not license litigants to fish in judicial ponds for legal advice."
* * * * * *
In the case of Bragg Development Co. v. Braxton, 239 N.C. 427, 79 S.E.2d 918, in 1950 the Federal Government by contract leased to plaintiff, a domestic corporation, a certain tract of land lying entirely within Cumberland County. The lease was for a period of 75 years. The lessee obligated itself to construct and *395 maintain on said leased land a housing project of 500 units for Army personnel.
In 1952 Cumberland County notified plaintiff that said property of plaintiff would be assessed for ad valorem taxes. The plaintiff, protesting, asserted that said property was not subject to taxation by the county and requested that the question be submitted to the court for decision under the Declaratory Judgment Act. The county agreed, and thereupon the proceeding was instituted.
The question presented for decision was: "Does Cumberland County have the right to levy and collect ad valorem taxes on the aforesaid property or any part thereof?"
Barnhill, J. (later C. J.) said:
"Here the facts agreed do not set forth a `question in difference which might be the subject of a civil action.' The defendant County has made no assessment. Neither has it levied upon this or any other property of plaintiff in an attempt to collect a tax on the property involved. No right of plaintiff has been denied or violated. It has suffered no wrong. It has sustained no loss either real or imaginary. On the facts agreed no justiciable question on which the court, in a civil action, could render a judgment is disclosed.
"Does the County have the right to tax the property of plaintiff which is located on the Fort Bragg Military Reservation? The County asserts this right. Plaintiff denies that it exists. The controversy thus created presents a purely abstract question. Any judgment putting it to rest would be wholly advisory in nature."
The appeal was dismissed.
* * *
In the instant case the City of Raleigh has issued no license pursuant to the provisions of the ordinance alleged to be unconstitutional. Moreover, nothing has been done in connection with said ordinance that has violated any rights of the plaintiffs.
See also Little v. Wachovia Bank and Trust Co., 252 N.C. 229, 113 S.E.2d 689; NASCAR, Inc. v. Blevins, 242 N.C. 282, 87 S.E.2d 490.
Borchard, Declaratory Judgments, 62, 63 (2d ed.1941) states:
So, a plaintiff contesting the applicability or validity of restrictive regulations under the police power need do no more than show that they in some way affect him deleteriously. But until the statute or ordinance is passed, the claim of privilege or immunity would be premature.
We find in 2 Anderson, Actions for Declaratory Judgments § 621, at 1415 (2d ed.1951) the following:
Indeed it is unnecessary for the assailed statute to have taken effect in order to entitle one whose rights it affects to contest the same by declaratory action. However, it is well settled that the court will not entertain a declaratory action with respect to the effect and validity of a statute in advance of its enactment. (Emphasis ours.)
In instant case there are five instruments which might appear to support a declaration of rights under N.C.Gen.Stat. § 1-254: the franchise of 1907, the thoroughfare plan adopted on 2 March 1959, the resolution adopted 7 January 1963 relative to the thoroughfare plan, the agreement dated 8 January 1963, and the proposed ordinance to require the railroad to remove the bridge abutments on West Peace Street.
The franchise of 1907 granted to the railroad the right to construct the trestle. The trestle was constructed according to the terms of the franchise, which resulted in the placing of abutments in the right of way on Peace Street. The only way that the city could compel the railroad to remove the abutments is by the passage of an ordinance *396 in the exercise of its police power. There is no controversy as to the rights of either party under the franchise, since the parties readily concede that the city under the facts here presented has the power to have the bridge reconstructed. The real question presented is which party shall bear the cost. A declaration of the rights of the parties under the franchise will not provide the answer.
The thoroughfare plan which designated certain streets to be widened and the resolution relative to the thoroughfare plan dated 7 January 1963 in no way imposed any obligation on the railroad to remove its bridge abutments so as to create an actual controversy between the city and the railroad.
The agreement of 8 January 1963 amounts merely to a recital of facts and an agreement by the parties to seek a declaration of rights under the Declaratory Judgment Act. Parties cannot confer jurisdiction upon a court in declaratory judgment proceedings by consent, stipulation or agreement. 22 Am.Jur.2d Declaratory Judgments § 75 (1965).
The very crux of this appeal lies in the construction of a proposed ordinance which the city has not enacted. The city has not exercised its granted police power by enacting the proposed ordinance. Proposal of the ordinance offers no assurance of its passage. No wrong has resulted to either party by reason of the proposed ordinance. The facts here alleged and found by the trial judge present a wholly abstract question and our decision on such facts would be purely advisory.
Construing the Declaratory Judgment Act liberally, as required by N.C. Gen.Stat. § 1-264, we hold that the trial court and the Court of Appeals erred in attempting to declare the rights of the parties since no justiciable controversy now exists between them.
The cause is remanded to the Court of Appeals with direction that it enter an order directing the Superior Court of Wake County to vacate the judgment entered and dismiss the action in this cause.
Cause remanded and judgment vacated.
PARKER, C. J., took no part in the consideration or decision of this case.
