Under normal circumstances I could get the spatial intersection between a table with multipolygons and another table with point geometry using some variant of
SELECT * FROM (SELECT * FROM point_geometries) s JOIN polygon_geometries sg ON ST_Contains(sg.geom, s.point_geom)
But I have a situation where instead of a table, I have a list of point geometries to input. If I only have one geometry then I can do
SELECT * FROM polygon_geometries WHERE ST_Contains(geom, '0101000020E6100000E73B8A05101056C01F1166ED49594440') which returns a single row from polygon_geometries giving me exactly what I want.
Now imagine I have 100+ geometries and I want to get all the rows from polygon_geometries where ST_Contains any of the points (in theory returning up to 100 rows from polygon_geometries). Is there a way to do this that doesn’t involve constructing WHERE ST_Contains(geom, string1) OR ST_Contains(geom, string2)… etc?
I’d love to be able to feed a list of the strings in, if possible. I simply can not find any examples of this!
Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.