In other than residence districts as established by the zoning resolution, fences may be erected throughout the city to a maximum height of ten feet. In residence districts, no fences, whether of masonry, steel, wood, or any other materials shall be erected to a height of more than six feet above the ground, except that fences used in conjunction with nonresidence buildings and public playgrounds, excluding buildings accessory to dwellings, may be erected to a height of fifteen feet Higher fences may be permitted by the commissioner where required for the enclosure of public playgrounds, school yards, parks, and similar public facilities.