Shulchan Aruch – Chapter 30

The Sabbath Boundary A person who is in an uninhabited region when the Sabbath begins may walk anywhere within a radius of 2004 cubits from his initial position, but is not allowed to go outside that region (397:1-2;401:1;405:3). If he is in a private domain that has an area of at most 5000 square cubits…