Take into consideration, Hyperfocal Distance.
...
In this case focusing to the hyperfocal distance wouldn't be exactly the best approach, there is nothing in the picture at infinity.
A better approach is to use a full DOF calculator, one that takes input for both the near limit distance and the far limit distance, rather than the special case hyperfocal distance calculators that always assume that the far limit is infinity.
Shots with this extreme range of distances are very difficult if you want everything to seem in focus. Note the following:
1. You must focus at the proper distance so that what DOF is available is used to best advantage. You don't want to wast DOF at distances closer than the close tree trunk for example. Measure the distance to the near subject, measure the distance to the far subject, and use this data in a DOF calculator to determine the distance to set on the focusing ring (it will be approx 1/3 of the way from the near to far limit) and what f/stop is necessary to achieve enought DOF.
2. Lenses do not product the best sharpness at excessively small apertures. Short focal length wide angles for crop sensor cameras generally begin to "go soft" at around f/11 to f/16. Stopping down further to f/22 or smaller generally has a noticably negative impact of sharpness.
3. Leaves move. Long shutter speeds run the risk of motion blur on foliage.
4. You can't hand hold 1/4 sec, even with vibration reduction systems, and get truely sharp images.
2.