How to find all the polygons inside of a polygon? I tried ST_Intersects and ST_Contains but they are booleans variables. I have a list of polygons in WKT format, so I am trying to pull all the polygons given a region in their WKT format.
Does anyone have an idea how to approach this?
select geom from polygon where
ST_Intersects(ST_GeographyFromText
('POLYGON((210000 2400000, 300000 2300000, 330000 3708400, 210000 2400000))'),
polygon.geom);
Answer
You are missing ST_AsText, as @WKT mentions above. This should work for you:
select ST_AsText(geom) from polygon
where ST_Intersects(ST_GeographyFromText
('POLYGON((210000 2400000, 300000 2300000, 330000 3708400, 210000 2400000))'),
polygon.geom);
No comments:
Post a Comment