Tamagaki is a fence around a shrine or shiniki (the holy precincts of a shrine).
Origin and transition
Then, himorogi (temporarily erected sacred space or "altar" used as a locus of worship) was combined with iwakura (dwelling place of a god, usually in reference to a large rock) or iwasaka (the area a deity sits), and the border eventually turned into Tamagaki, which can be seen in current Shrine, instead of stone-built fences.
Transition of form
Shiba-gaki fence (a brushwood fence) which is made of trees is considered to be the oldest form of Tamagaki.
Tamagaki comes in a variety of forms such as ita tamagaki (board fence) which is made up of thick boards, kuroki no tamagaki (unbarked lumber fence) which uses unpeeled timber, suigaki (see-through fence) which is widely spaced.
In recent years, some Tamagaki are made of tree or stone, and others are made of cement. Tamagaki may carry the name of its donator.
Name and meaning
Nature, meaning, and name of Tamagaki in the current Jinja Shinto
Meaning and synonym
瑞垣 (Mizugaki), 斎垣 (Imigaki, Ikaki, Igaki), and 神垣 (Kamigaki) all have the same meaning as 玉垣 (Tamagaki).
Word '玉', '瑞', and '斎' all have the meaning of 'holy' and 'beautiful.'
Those words are combined with '垣' which has the meaning of enclosure to form a word 'holy and beautiful enclosure for the god.'
Meaning and synonym in case of overlapping enclosure
Multiple layers of tamagaki may be created. In general, the innermost layer is called Mizugaki, and other layers are referred to as Aragaki or Itagaki. These names may be used together. Goshoden (main sanctuary) of the Inner Shrine of Ise is surrounded by four layers of fence.
Starting from the most innermost fence, those fences are called Mizugaki, Uchi-tamagaki (inner fence), Soto-tamagaki (outer fence), and Itagaki respectably.