If it is irrigation only there are no codes to be concerned with. The only area if the water source is from a municipal water company (city water) that there must be a backflow device or a well used for domestic water. In Florida there is a code on the distance a sprinkler can be to the home structure.
If this is a water supply for a cabin, etc. then there could be codes for pipe depth. Burying a pipe in the frost zone, with each freeze the pipe could work itself to the surface from the heave and eventually break.