I have one collection which contains polygons and one collection which contains point locations, and I would like to see which locations are in each polygon and tag the locations with the ID of the polygon.
To accomplish this, I thought I'd implement a stored procedure in the polygon collection which retrieves all polygons and then for each polygon call a stored procedure in the location collection. The second procedure would take polygon ID and polygon coordinates as input and use the ST_WITHIN method to check which locations are within the polygon.
Is it possible to solve it this way and is it a good way?