When measuring for the length of an irrigation backflow device allow 3" to 5" to each end to compensate for the thickness of the backflow preventer.
For the height, measure from the ground to the highest point.