They originate in books like some Yujo hyoban-ki (guidebooks to prostitutes in the red-light districts) in kana zoshi (novels written for women and children using kana rather than Chinese characters to make them easily understood), and the descriptions of pleasure quarters appearing in the Ukiyozoshi (literally, Books of the Floating World) of Saikaku IHARA and others.
もとは仮名草子の遊女評判記の類や、井原西鶴らの浮世草子にある遊里の描写がルーツである。