Kleingärten (singular Kleingärten), also known as Schrebergärten, result from an idea suggested in the 1860s in Germany, leased allotments to give city dwellers their own little back yards in which their children could play.
People started to grow their own crops as well.
They’re all over Germany, and not uncommon to spot near train tracks.
We just passed a large “neighborhood” as we left Dresden.
More information here:
Similar allotment garden schemes exist in many countries, including the US and Canada, where they are usually called Community Gardens. More information than you probably need here: