They are only territorial while in the water.
It was built in different areas by different dynasties to protect different territorial borders.