Human gait is a key biomarker for health, independence and quality of life. Advances in wearable inertial sensor technologies have paved the way for out-of-the-lab human gait analysis, which is important for the assessment of mobility and balance in natural environments and has applications in multiple fields from healthcare to urban planning. Automatic recognition of the environment where walking takes place is a prerequisite for successful characterisation of terrain-induced gait alterations. A key question which remains unexplored in the field is how minimum data requirements for high terrain classification accuracy change depending on the sensor placement on the body. To address this question, we evaluate the changes in performance of five canonical machine learning classifiers by varying several data sampling parameters including sampling rate, segment length, and sensor configuration. Our analysis on two independent datasets clearly demonstrate that a single inertial measurement unit is sufficient to recognise terrain-induced gait alterations, accuracy and minimum data requirements vary with the device position on the body, and choosing correct data sampling parameters for each position can improve classification accuracy up to 40% or reduce data size by 16 times. Our findings highlight the need for adaptive data collection and processing algorithms for resource-efficient computing on mobile devices.