Suppose I have a table containing some Locations belonging to different categories ('schools', 'hospitals', 'stations' etc...). I also have some points of interest (they can be in the same table if it's better or they can be in a different one, also asking advice on this) which can be something like 'bus stop', 'restaurant', 'pub' etc...
My question is: is it possible, with PostGIS (I'm going to use GeoDjango + PostGIS, but you can ignore the Django specific part if you want), to perform queries like these:
- Find all 'schools' within 1 Km from a 'station'
- Find all 'restaurants' within 2 Km of a 'park'
- Find all 'hospitals' within 2 Km of a 'park'
I've seen example where, given a specific point or polygon, I could get all the records within a certain distance, but in this case there is not specific starting point. I need all the records of a certain category, within x Km from another category.