[GIS] How to perform spatial query using openlayers and geoserver

geoserveropenlayers-2

I have on my geoserver 2 shp files : pipes and buildings.
I would like to put a form on my openlayers page that when user click it , he can choose distance (10m , 20m, etc…) and get a result of => all pipes in distance X from buildings.

How can I do that using geoserver (I don't wish to upload my shp files to any database because they are being updated regularly)?

Best Answer

I would recommend you to read something about CQL. Good starting point might be here and there. You should be probably the most interested in DWITHIN geometric predicate.

PS: And there.