#3844 closed enhancement (fixed)
b-tree support for strict equality test and spatially adjacent ordering
Reported by: | pramsey | Owned by: | pramsey |
---|---|---|---|
Priority: | critical | Milestone: | PostGIS 2.4.0 |
Component: | postgis | Version: | master |
Keywords: | Cc: |
Description
Change the = operator to test the binary geometry representations directly, to allow more "rational" GROUP BY behavior on geometry. Also enhance the ≠ operators to sort based on a rough morton key to put rows ordered by geometry columns into a rough "things near in the list are near in space" ordering.
Change History (13)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Topology relies on OPERATOR < to be usable to find leftmost geometry. Isn't this a bit too big of a change to be done after feature freeze ?
comment:5 by , 7 years ago
strk you should never have been using an undocumented operator use << instead
comment:6 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
ci machines all seem happy with this and Komzzpa likes it too. I'm happy he's happy.
18:34] <Komzzpa> I like the patch :)
comment:7 by , 7 years ago
OPERATOR << returns false on overlap:
select 'LINESTRING(0 0, 10 0)'::geometry << 'LINESTRING(2 0, 12 0)'::geometry; ?column? ---------- f (1 row)
So it cannot be used to find the left-most edge of a topology.
comment:8 by , 7 years ago
Well, we found a user who depended on the old logic, and surprise, he's one of us!
No, < won't be good for edges anymore, (a) because it uses box centroids and (b) sorting is on morton key (somewhat), so the sorted set won't line up in a neat line but will zigzag around the plane.
comment:9 by , 7 years ago
Could replacing "ORDER BY geom" with "ORDER BY ST_XMin(geom)" be sufficient? Where does this "find the left edge" logic happen?
comment:10 by , 7 years ago
For the record: as of r15708 I've changed the code to ORDER BY ST_XMin(geom) instead.
With this change the expected result gets back to its original, which is good.
comment:11 by , 7 years ago
Logic happens on line 167 topology/sql/export/TopoJSON.sql.in but I've been thinking about using it also for other cases (polygonization)
Done at r15700, waiting for the CI machines to all crash