I use the following code for creating the circle:
var circle = OpenLayers.Geometry.Polygon.createRegularPolygon( new OpenLayers.Geometry.Point(X, Y), 1, 30 );
and then I'm planning to use the following SELECT Query in my php code:
SELECT b.geom FROM buildings AS b WHERE ST_WITHIN (b.geom, ST_MAKEPOLYGON(circle, srid));
Q1: how can I pass the geometry created for the circle from my .JS file to .php file? can I pass it as an object? can I do something like below??:
Q2: Is my SELECT query correct? Am I using the correct function ST_MAKEPOLYGON?
Any suggestions/help would be highly appreciated.