Built on plains, the hirajiro castles were hard to defend, their location being selected based on political or economic, rather than military criteria. So, if no natural barriers were available, moats and stone walls were constructed to improve the defense capability.
Here is one of the largest and at the same time the best-preserved hirajiro castle, Matsumoto-jō, with the tenshu surrounded by wide and deep moats filled with water, making it look like it was built on an island...
EXIF info:
Nikon D90
Lens: 8-16mm F/4.5-5.6G
Focal Length: 8mm
Aperture: F/7.1
Shutter Speed: 1/400s
ISO Sensitivity: ISO 200