
21 Mich. App. 587 (1970)
175 N.W.2d 798
S.B.S. BUILDERS, INC.
v.
CITY OF MADISON HEIGHTS
Docket No. 6,721.
Michigan Court of Appeals.
Decided February 5, 1970.
*589 Hyman, Gurwin, Nachman, Friedman & Weingarden, for plaintiffs.
Harry H. Young, City Attorney, for defendant.
Before: LEVIN, P.J., and DANHOF and T.M. BURNS, JJ.
T.M. BURNS, J.
In 1962, the City of Madison Heights, pursuant to statutory authority MCLA §§ 125.32, 125.36, 125.37 (Stat Ann 1958 Rev §§ 5.2992, 5.2996, 5.2997), hired a land use planning firm which made a two year study of the city's land requirements. This resulted in the adoption of the present zoning ordinance. Plaintiff S.B.S. Builders, Inc., claims to be the titleholder of three lots within the city. These lots are located in an R-2 residential zone having a minimum lot width requirement of 60 feet. Plaintiff's lots are all 40 feet in width and were platted before the present zoning ordinance became effective. Plaintiff Seligman & Associates, Inc., a residential builder, was refused building permits on the three lots because of § 10.503(2) of the zoning ordinance. A request was made to the Zoning Board of Appeals for a variance from the ordinance requiring the lots to be combined to comply with the 60-foot minimum provision. The request was denied, and plaintiffs brought a mandamus action in the Circuit Court of Oakland County for a judgment directing the Madison Heights' building inspector to issue building permits for residential construction on the three 40-foot lots. The parties appeared for trial on October 31, 1968. At that time, the trial court suggested that the case be settled and accordingly adjourned the trial date to November 7, 1968. When the parties were unable to reach a settlement, the court, upon its own motion, ordered *590 that the writ of mandamus be issued on November 27, 1968 granting plaintiffs the relief they sought. Defendant objected to the judgment being entered without any testimony taken, the viewing of any exhibits or affording it the right of trial. Objection was also taken to the court acting on its own motion without the plaintiffs having made a motion for summary judgment. On December 4, 1968, the trial court filed an opinion wherein § 10.503(2) of the city's zoning ordinance was found to be unconstitutional.[*]
The trial court found that although the burden of proof was on plaintiffs, no proof was necessary as he considered the ordinance unconstitutional on its face. He said: *591 "By the terms of defendant's ordinance, if five property owners each owned a single 40 foot lot within a subdivision, whether or not adjacent to each other, each could conceivably build an individual home upon his lot. However, if one man owned all five lots, he could be forced to combine the lots and build not more than three homes, each of which would have to be a minimum of 60 feet in width. Unless one or more of the sites were larger than 60 feet in width, 20 feet of land would be useless. There is no rational or legal justification for such an ordinance which deprives an owner of a substantial portion of his property solely because he happened to own more than 1 lot at the date upon which the ordinance was passed."
In Shacket v. Township of Highland (1969), 15 Mich App 543, this Court was faced by almost the identical situation as here. The trial court in Shacket, supra, had issued a writ of mandamus peremptorily without taking testimony on the basis that as a matter of law the ordinance was invalid on its face. The Court in Shacket, supra, p 544 said:
"The ordinance * * * may or may not be valid, depending on whether such a prohibition, as it relates to plaintiff's land, is reasonable or unreasonable. This determination is impossible without evidence."
The trial court here found that, "[t]here is no rational or legal justification" for the ordinance. Yet, as in Shacket, supra, whether there is a "rational or legal justification" depends upon whether the restriction has some reasonable relationship to the "health, safety, or general welfare." Such a determination cannot be made without a thorough examination of all the evidence. Shacket v. Township of Highland, supra. Therefore, the trial court erred in granting the writ without taking evidence.
*592 On remand the plaintiffs must establish that the ordinance has no reasonable relationship to the health, safety, or general welfare of the city's residents, or mandamus may not issue. See Rottman v. Township of Waterford (1968), 13 Mich App 271.
Further, under § 10.702(1) of the defendant's zoning ordinance building permits are issued by the building inspector. This being an action in mandamus the building inspector is a necessary party and should be added as a party defendant. See Boron Oil Company v. City of Southfield (1969), 18 Mich App 135, 144.
Because of our decision herein the other issues sought to be raised on appeal require no further discussion.
Reversed and remanded for hearing. Costs to defendant.
All concurred.
NOTES
[*]  § 10.503(2) of Madison Heights' zoning ordinance provides:

"Nonconforming Lots: In any district in which single family dwellings are permitted, notwithstanding limitations imposed by other provisions of this ordiance, a single family dwelling and customary accessory buildings may be erected on any single lot of record at the effective date of adoption or amendment of this ordinance, provided such lot is located in a block on which 51% or more of the lots on both sides of the street are occupied by single family dwellings. Where 51% or more of the existing homes are built upon a larger lot or combination of lots, a building permit will not be granted for a lot of less area or width than the size of the lots of the majority of the dwellings existing at the time of passage of this ordinance. In those areas where less than 51% of the lots are built upon in a one block area, the provisions regarding the use of combined lots shall apply. Permission to use a single nonconforming lot as herein provided shall apply even though such lot fails to meet the requirements for area or width; or both, that are generally applicable in the district, provided that yard dimensions and other requirements not involving area or width or both, or the lot shall conform to the regulations for the district in which the lot is located. If two or more lots or combinations of lots and portions of lots with continuous frontage in single ownership are on record at the time of passage or amendment of this ordinance, and if all or part of the lots do not meet the requirements for lot width and area as established by this ordinance, the lands involved shall be considered to be an undivided parcel for the purposes of this ordinance, and no portion of said parcel shall be used or occupied which does not meet lot width and area requirements established by this ordinance, nor shall any division of the parcel be made which leaves remaining any lot with width or area below the requirements stated in this ordinance." (Ord. #271.) (Emphasis supplied.)
