Yes B31.4&8 are the correct codes for onshore pipelines (and include their respective parts for offshore lines). Span lengths are determined by the engineer. In most cases span lengths will be zero for onshore pipelines, unless you know of a specific problem where it is not, such as an aerial crossing of a short revine where the pipe is basically left exposed and possibly totally unsupported for what might be a distance as long as 10 to 15 meters for some larger diameter pipelines.