Having the possibility of routing messages only toward specific areas or subscribing to messages originating in specific locations seems natural when a publish-subscribe model of communication is adopted. Unfortunately, very few work have investigated such kind of services and none of the most widely adopted publish-subscribe middleware implements them. In this paper we first classify possible location-based publish-subscribe services, then we describe an algorithm to efficiently implement them in a distributed publish-subscribe middleware.