Sample Header Ad - 728x90

Should I join all of my polygons to make a single polygon for point-in-polygon search?

1 vote
2 answers
511 views
I have a set of of polygons. Sometimes they are completely disconnected (like separate patches). Other times, two sides of two polygons may touch each other (when the polygons are adjacent like on a chess board). The polygons never cross each other. In other words, their intersection is always empty. I need to check if a point is contained in any one of those polygons. Is there a way I can build a single geometry using these polygons and check if the point is in it? Currently I'm building a long WHERE close with OR conditions and do something like the below: st_contains(st_GeomFromText('POLYGON(("+polygon+"))'), st_GeomFromText(CONCAT('POINT()')))
Asked by kovac (167 rep)
Jan 18, 2018, 09:38 AM
Last activity: Jan 20, 2025, 12:04 AM