92 Members
Spatial objects for PostgreSQL | http://postgis.net | logs at https://view.matrix.org/alias/%23postgis:matrix.org4 Servers

Load older messages

Timestamp Message
8 Apr 2020
19:37:32@freenode_velix:matrix.orgvelixIn my polygons.
20:11:51@freenode_robe2:matrix.orgrobe2velix Yah Simon and I are pals
20:12:42@freenode_velix:matrix.orgvelixOthers write love letters, you write PLSQL.
9 Apr 2020
10:36:06@freenode_velix:matrix.orgvelixIs there a way to check, if the red rectangle lies completly inside the yellow polygon? https://imgur.com/a/XrfB4P1
10:36:34@freenode_velix:matrix.orgvelixMaybe a check, if at least two outer nodes are equal?
10:36:12@freenode_sigq:matrix.orgsigqTitle: Imgur: The magic of the Internet (at imgur.com)
10:38:58@freenode_velix:matrix.orgvelixactually, ALL nodes of the red polygon need to exist in the yellow one!
10:39:20@freenode_velix:matrix.orgvelixSo I just could get all nodes, put them into two arrays and check, if all of the red ones match with the yellow one.
10:43:14@_slack_osgeo_UJKE61D43:matrix.orgdbaston st_contains(yellow, st_points(red))
10:43:29@freenode_velix:matrix.orgvelix dbaston: Are you sure?
10:43:38@freenode_velix:matrix.orgvelix dbaston: There's no yellow under the red
10:43:50@freenode_velix:matrix.orgvelixahh, ST_Points!
10:43:57@freenode_velix:matrix.orgvelix dbaston: Thanks, I'll try.
10:44:11@freenode_velix:matrix.orgvelix dbaston: But my approach wasn't bad, was it?
10:47:30@_slack_osgeo_UJKE61D43:matrix.orgdbaston they're functionally equivalent
10:47:36@twelvechairs:matrix.orgtwelvechairsyou want the points or the area?
10:48:31@twelvechairs:matrix.orgtwelvechairsyou could do a convex hull and then see if that contains the other shape if thats what you are looking for
10:50:25@_slack_osgeo_UJKE61D43:matrix.orgdbaston just re-read what you're asking. if you want to test that all nodes of A are also nodes of B, it's actually st_contains(st_points(b), st_points(a))
10:50:54@freenode_Algunenano:matrix.orgAlgunenanoAnother option might be something like `ST_Within(a,b) AND ST_Touches(a, ST_Boundary(b))` with b being the bigger polygon, I think
10:53:38@_slack_osgeo_UJKE61D43:matrix.orgdbaston st_contains(st_points(b), st_points(a) AND st_contains(b, st_pointonsurface(a)) to cover edge case where b is a hole of a
10:55:11@freenode_velix:matrix.orgvelix dbaston: Then it might be faster to create arrays and index those.
10:55:29@freenode_velix:matrix.orgvelix dbaston: Can st_contains(st_points(b), st_points(a)) be covered by gist/spgist?
10:55:53@freenode_velix:matrix.orgvelixMayber st_points(geom) to a new column and an index on this might be faster.
10:56:07@freenode_velix:matrix.orgvelix I've got more than 1 polygon in total, this was just a simplified example.
10:56:14@freenode_velix:matrix.orgvelix Algunenano: Thanks, I'll play with this.
15:54:27@_slack_osgeo_UJM07FH5H:matrix.orgMartin Davis dbaston Don't forget that "polygons do not contain their boundary". So using ST_Contains(polygon, boundary points) = FALSE.
15:54:37@_slack_osgeo_UJM07FH5H:matrix.orgMartin Davis Could use ST_Covers though
15:54:51@_slack_osgeo_UJM07FH5H:matrix.orgMartin Davis This is the most annoying thing about the OGC predicate definition

There are no newer messages yet.

Back to Room List