It gets tricky, especially for larger communities where only a small percentage is relevant to the story. So far I have rarely needed to.
On my fantasy world, the largest city is the Throne City for the Treaty States of Sadrahanal (the city ruler has absolute power within the city confines, and acts as an arbiter in any issues between the member states, but beyond that has no power unless a state of war exists, then the ruler gains absolute authority over every Treaty state, unless they rebel and join the other side):
Originally, three communities formed where two mighty rivers met on their journeys down from the mountains and formed a third, greater river which empties out into the sea a week's journey to the southeast. Sadra and Ahan controlled traffic along the three rivers, with inns, taverns, permanent and temporary housing, warehouses and, in Sadra, a large shipyard, supplied by the forests to the west, while Nahal provided farmland for its neighbors and a place for the smithies, masons and tanners to ply their trades.
Then the Assassin-King forged the Treaty States and decided to build his castle above the point where the three rivers met, constricting one of the largest bridges ever made to serve as its foundation. Over the years since, others built houses, shops, inns and taverns along that bridge, expanding it outward - and the nobles built their houses on top of these structures, so each successive ruler has added more bridges and more levels, guaranteeing that the Palace of Sadrahanal is the tallest man-made structure in the region at all times.
The resulting merged city has become known also as The City of Tiers, as the lowest levels are dark and dangerous, kept in the shadows by the upper classes literally and figuratively, while the nobles tower above them like gods, and the Ruler sits higher still...