Nijo Castle was built by the shogunate around 1600. There are two main buildings, Ninomaru Palace and the castle itself, with its immense walls and moat. 
The entrance gate to Ninomaru Palace.
Ninomaru Palace is the largest building on the castle grounds. It's famous for its "nightingale floors," which squeak when you walk across them so as to warn the residents of invaders. You can take a self guided tour of the palace, but I didn't have time as the castle grounds were closing shortly after I arrived.
Detail of decorative wall in Ninomaru Palace.
The garden to the side of Ninomaru Palace is beautiful. My friend Toshi thought that the straw was protecting young trees.
Another picture of the garden.
Precursor of "gated communities": the bridge over the castle moat, and a gate into the castle
The huge moat and immense walls protecting the castle.
Climbing the stairs that take you over the castle walls, you get your first view of the castle.
The castle itself is quite impressive.
A lone tree planted behind the castle wall.
The doors to get through the castle gates were also immense: about a foot thick.