Media playback is unsupported on your device Media caption Demand for housing has led to an increasing number of makeshift extensions

If you ever visit Taiwan's capital, your first impression might be that some of the buildings are a mishmash of units constructed haphazardly.

While skyscrapers stand out in Taipei's skyline, it's hard to miss the mosaic of metal roofs in varying colours. They belong to the thousands of units that have been illegally constructed on top of or next to buildings.

Not only in Taipei, but throughout Taiwan, home owners have been building additions to their property for decades, often without permits or adherence to building codes. What's driving this practice is the scarcity of space in the cities and high property prices.

Most people can't afford to buy a big flat. So they find ways to create more space.

Some turn balconies into enclosed rooms. Others take over fire lanes between buildings. And almost everyone with a top-level flat finds a way to build one or more units up on the roof.

The units are generally not torn down because any politician who suggested such a move would be committing political suicide.

The units provide rental income for property owners, or housing for their grown children. And if they decide to sell their property, they can count the illegal additions as part of their space, earning a higher selling price.

They also provide cheaper locations for small businesses, and affordable housing for students, newcomers to the cities and others on a tight budget.

Image caption Officials are cracking down on illegal structures that may pose a safety hazard

For decades, the government has tolerated illegal construction, dealing only with violations that pose a risk to public safety. Many cities have even exempted illegal units built in previous decades from being demolished.

But a recent series of deadly fires involving illegal construction has prompted newly elected mayors in several cities to order some of the worst violations to be torn down.

One blaze at a bowling alley made of metal sheeting in nearby Taoyuan City killed six firefighters. Another deadly blaze in Taipei involved a rooftop constructed with several units, making it difficult for fire fighters to save the occupants.

Many cities, including Taipei, have ordered the most serious violations to be torn down. Taipei's newly elected Mayor Ko Wen-je for example has demanded property owners with three or more units on roof reduce the number or face the demolition crew and a bill for the demolition.

But city workers have been demolishing illegal construction for years; it's just they can't keep up with the number of new units being built each year. The government estimates there are nearly 600,000 such units in Taiwan, but the actual number could be much higher.

Officials admit they can only look into those that pose an obvious safety hazard or have generated complaints. And tearing down the ones deemed intolerable is also far from easy.

Chiang Fu-kuo, a Taipei City demolition official, says the process is long and difficult.

"The owners feel it's their asset…They've spent so much money on them, so some people feel very emotional, they threaten to jump off buildings or set themselves on fire," said Mr. Chiang. "So we have to first make sure the owners' emotional state is stable."

One man recently did just that, killing himself by jumping off a building.

Many owners use delaying tactics such as not replying to notices put up by the demolition crews and simply never being around when the workers come knocking on their door.

Image copyright AFP Image caption Taipei has a varied skyline thanks to illegally constructed units on top of buildings

Image caption Taipei city workers have been demolishing illegal construction for years

Unlike in poorer countries, in Taiwan the owners of illegally constructed properties are often middle class.

Bernice Chang has been living with her family in a rooftop addition for years. When she and her husband bought the top level apartment of a building, it came with the addition.

She used to rent it out to earn income. Now she, her husband and two children live in the three bedrooms on the rooftop, while also using the lower level apartment's kitchen and living room.

"We were young at the time and thought we could rent out the unit to help pay the mortgage," said Ms Chang. "But now that I know more about structural safety, I do think these units shouldn't have been built in the first place. They add weight to the building."

Image caption Bernice Chang and her family live in the rooftop addition above their apartment

Some of the units are sought after by not only locals but expats like American John van Trieste.

He lives in a rooftop studio made of metal sheeting and plywood. It has a small bathroom and laundry room, but no kitchen. He tried to move out because he was worried about safety issues, but moved back in because he likes the peace and quiet of being on the top level.

"Basically you may not have any neighbours; it'll be quiet usually, but there's very little insulation, there's extremes of temperature, and maybe noise if it rains," he says.

"It's very hot in the summer and very cold in the winter. It can be quite noisy when a typhoon comes because of the metal sheeting on the roof. When we get earthquakes, I worry is it going to be the time it falls on my head. "

"But they are everywhere. Where would they put all the people who live in them if they tear them down?" he asked.

That's exactly how the government feels.

So despite the demolitions, few people believe the problem will go away. Illegal units have become an integral part of Taiwan's housing and it seems they will continue to dot the skyline.