MB4 261b: Introduction to Hilchos Techumim (396:1-2)

Based on a pasuk in Beshalach, a person is restricted on Shabbos to an area that is four amot in all directions (which Chazal say refers to a person who leaves his techum on Shabbos). How to calculate the four amot.

A person's 4 amot includes the entire city in which one finds oneself on Shabbos. The 2000-amah techum only begins at the edge of the city in which one is located.

What constitutes a city vis-a-vis measuring a 2000-amot radius? What if an area is enclosed but not inhabited?