Maseches Eruvin, Chapter 10, Mishnah 7. The Mishnah deals with a pit and a refuse heap located in the public domain, and how they may be used on Shabbos from a window that faces them.
"Bor bireshus harabim vechulyaso gevohah asarah tefachim - chalon she'al gabav memal'in heimenu beShabbos" - a pit in the public domain whose surrounding rim is ten tefachim high: from a window above it one may fill water on Shabbos:
A pit located in the public domain that is surrounded by a rim ten tefachim high, even though it stands in the public domain, is turned into a private domain by the rim that encircles it. Therefore, from the window above that pit one may fill water on Shabbos: a person standing at the window, which is a private domain, lowers a bucket into the pit and fills it with water, even though the pit itself is situated in the public domain.
Two situations in which this permission applies:
The pit is four tefachim away from the window. True, in this case the public domain separates between the pit and the window, but since the rim surrounding the pit is ten tefachim high, the bucket passed from the window into the pit travels above the rim - that is, higher than ten tefachim above the public domain, which is an exempt area. It emerges that the transfer is from a private domain, through an exempt area, into another private domain, and that is permitted.
The pit is adjacent to the wall of the house and to the window, with less than four tefachim between them. In such a case there is no public domain here at all.
"Ashpah bireshus harabim gevohah asarah tefachim - chalon she'al gabah shofchin lesochah mayim beShabbos" - a refuse heap in the public domain ten tefachim high: from a window above it one may pour water into it on Shabbos:
The law is the same with a refuse heap: a pile of refuse in the public domain that is ten tefachim high has the status of a private domain within the public domain. Therefore, from the window above it one may pour water into it on Shabbos, and this applies in the same two situations explained regarding the pit - whether there is a distance of four tefachim from the window, or whether the refuse heap is within four tefachim - since in either case the transfer is made from a private domain, through an exempt area, into another private domain.
Specifically a public refuse heap:
The Gemara clarifies that the Mishnah is speaking of a public refuse heap, which there is no concern will be cleared away. A privately owned refuse heap is liable to be removed by its owner, and then there is reason to be concerned that a person will pour out water without noticing that the heap has already been cleared away, and it turns out that he is pouring into the public domain. With a public refuse heap there is no such concern.
In summary: We learned that a pit surrounded by a rim ten tefachim high, and likewise a refuse heap ten tefachim high, are considered a private domain even though they are located in the public domain. Therefore one may fill water from the pit and pour water into the refuse heap from the window above them - whether they are four tefachim away from the window (and the transfer is made higher than ten tefachim, in an exempt area), or whether they are adjacent to the wall within four tefachim. And all this applies to a public refuse heap, where there is no concern that it will be cleared away.