Commentary for Berakhot 49:6
תניא כותיה דרב חסדא לא יקרא אדם ק"ש לא כנגד צואת אדם ולא כנגד צואת כלבים ולא כנגד צואת חזירים ולא כנגד צואת תרנגולים ולא כנגד צואת אשפה שריחה רע ואם היה מקום גבוה עשרה טפחים או נמוך עשרה טפחים יושב בצדו וקורא ק"ש ואם לאו מרחיק מלא עיניו וכן לתפלה ריח רע שיש לו עיקר מרחיק ד' אמות ממקום הריח וקורא ק"ש
There is a teaching in agreement with Rab Hisda : A man should not read the Shema' opposite the excrement of a human being, or of dogs, or pigs, or poultry ; nor opposite the filth of a dunghill which gives forth a bad odour. If there be a place ten cubits higher or lower, he sits down at the side and reads the Shema'; but if not, he removes himself as far as he can see it. The same rule applies to the Tefillah. "If there is a foul odour for which there is a cause [present], he removes himself a distance of four cubits from the place of the odour and reads the Shema'."