Opened 13 years ago
Closed 15 months ago
#1778 closed defect (wontfix)
ST_CollectionExtract: inconsistent EMPTY results
Reported by: | strk | Owned by: | strk |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS Fund Me |
Component: | postgis | Version: | 2.0.x |
Keywords: | Cc: |
Description
strk=# select ST_AsEWKT(ST_CollectionExtract('LINESTRING EMPTY', 2)); st_asewkt ------------------ LINESTRING EMPTY (1 row) strk=# select ST_AsEWKT(ST_CollectionExtract('GEOMETRYCOLLECTION EMPTY', 2)); st_asewkt ----------------------- MULTILINESTRING EMPTY (1 row)
Why is it a _single_ empty in the first case but a _multi_ empty in the second ? How to transform a multi to a simple ? (ST_Homogenize missing)
Attachments (1)
Change History (11)
follow-up: 2 comment:1 by , 13 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 13 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Replying to pramsey:
Actually the behaviour is consistent: when passed a non-collection, the function just echoes it back.
Not true. Was changed some time ago to always return the requested type:
=# select ST_AsText(ST_CollectionExtract('POINT(0 0)', 2)); st_astext ------------------ LINESTRING EMPTY (1 row)
See #457
It would be consistent to always return the MULTI* version of the requested type...
comment:4 by , 12 years ago
Milestone: | PostGIS 2.0.1 → PostGIS 2.1.0 |
---|
Ah, and how I know why I don't like this improvement, it breaks regression (of course, I knew that, but it's more obvious when the regression tests fail, which they do). So this change would change the behaviour of the 2.0 branch. I'm pushing it forward to 2.1 on principle.
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Changed to always return MULTI* at r9764
comment:6 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
...aaand, backed out again at r9766
strk, if you want this you'll have to apply it yourself and fix/change the topology code to match.
comment:7 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:10 by , 15 months ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Actually the behaviour is consistent: when passed a non-collection, the function just echoes it back. This is true with both empties and non-empties.
The return for non-empty collections is always a homogeneous multi-something, even if the input collection has only one member.