#2199 closed enhancement (fixed)
[raster] ST_Union only considering first band if uniontype specified
Reported by: | robe | Owned by: | robe |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.1.0 |
Component: | documentation | Version: | master |
Keywords: | Cc: |
Description
I'm not sure if this was just missed or too hard to do. If difficult, I guess we just need to amend the docs. Anyrate if I explicitly say 'LAST' vs. leaving it out I should get the same answer.
It seems ST_Union is still only returning first band if you specify a union type. Observe:
— this returns bright beautiful picture —
(WITH mset AS ( SELECT ROW_NUMBER() OVER() As rnum, rast FROM (SELECT ST_Tile(rast, (ST_Width(rast))::integer/2, ST_Height(rast)/2) As rast FROM (SELECT ST_Resize(rast,0.10,0.10) As rast FROM pics WHERE filename='Mona_Lisa.jpg' LIMIT 1) As foo ) As foofoo ) SELECT ST_Union(ST_SetUpperLeft(rast,ST_UpperLeftX(rast)*-1,ST_UpperLeftY(rast)*-1)) FROM mset where rnum IN(1,2))
— this returns grey scale — verified it ST_NumBands only returns 1 —-
SELECT ST_Union(ST_SetUpperLeft(rast,ST_UpperLeftX(rast)*-1,ST_UpperLeftY(rast)*-1), 'LAST') FROM mset where rnum IN(1,2))
See attached images.
Using same image I described here from wikipedia
http://www.bostongis.com/blog/index.php?/archives/207-Waiting-for-PostGIS-2.1-ST_Tile.html
Attachments (2)
Change History (8)
by , 12 years ago
Attachment: | explicit_last.png added |
---|
by , 12 years ago
Attachment: | default_last_behavior.png added |
---|
comment:1 by , 12 years ago
Summary: | [raster] ST_Union not considering other bands except for LAST → [raster] ST_Union only considering first band if uniontype specified |
---|
comment:2 by , 12 years ago
Status: | new → assigned |
---|
comment:3 by , 12 years ago
Looking at the docs, I evidently stated that "ST_Union(rast) now unions all bands of all input rasters". I believe I intended ST_Union(rast) unioning all bands to only apply to variant #1.
comment:4 by , 12 years ago
Component: | raster → documentation |
---|---|
Owner: | changed from | to
Status: | assigned → new |
Type: | defect → enhancement |
Ah I see you wrote ST_Union(rast). I guess I wasn't looking closely. Maybe we can make it clearer. I'll just change this to a documentation enhancement and fix later, since its technically not wrong just could be clearer.
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Okay I reworded at r11081 just so I don't get confused
http://postgis.net/docs/manual-dev/RT_ST_Union.html
I'll put in as an enhancement if not ticketed already
comment:6 by , 12 years ago
I reworded yet again at r11082 as I realized when writing this long diatribe and trying to explain this oddball that it's only
ST_Union(rast,uniontype) that is problematic.
Also documented that the unionarg variant is new in 2.1.0.
Gah! I'm on it.