Opened 12 years ago
Closed 12 years ago
#2126 closed defect (fixed)
[raster] Convex hull of an empty raster
Reported by: | Bborie Park | Owned by: | Bborie Park |
---|---|---|---|
Priority: | blocker | Milestone: | PostGIS 2.0.3 |
Component: | raster | Version: | 2.0.x |
Keywords: | history | Cc: |
Description
What is the convex hull of an empty raster (raster = NULL or width/height = zero)?
For a NULL raster...
SELECT ST_ConvexHull(NULL::raster) st_convexhull --------------- (1 row)
For a raster with width or height set to zero...
SELECT ST_ConvexHull(ST_MakeEmptyRaster(1, 0, 0, 0, 1, -1, 0, 0, 0)) ERROR: RASTER_convex_hull: Could not get raster's convex hull
Instead of an error, shouldn't the answer be NULL?
Change History (11)
comment:1 by , 12 years ago
Milestone: | PostGIS 2.0.2 → PostGIS 2.0.3 |
---|
comment:2 by , 12 years ago
comment:3 by , 12 years ago
For rasters, it may be that the convex hull is _NOT_ polygonal in three cases.
Case 1 and Case 2: raster width OR height is zero (but other dimension is NOT zero)
Possible Answer: LINESTRING along the non-zero dimension from upper-left
Case 3: raster width AND height is zero
Possible Answer: POINT of upper-left.
Granted, I'm just as happy returning POLYGON EMPTY as it is keeping it simple. But I wonder if raster should be as arbitrary as geometry. I wonder what ArcGIS, ENVI and ERDAS says...
comment:5 by , 12 years ago
Status: | new → assigned |
---|
comment:6 by , 12 years ago
Priority: | medium → blocker |
---|
comment:7 by , 12 years ago
I'd vote for POLYGON EMPTY
what other dimension are you talking about? I thought raster spatial foot print is strictly 2D.
comment:8 by , 12 years ago
I used dimension to describe width or height of the grid. raster spatial footprint is strictly 2D (for now).
comment:9 by , 12 years ago
We defined an empty raster by width and height = 0 but still an empty raster can have a georeference and hence being like a unidimensional point somewhere. If only one of width or height is = 0 then it is more like a line (hence bidimensional and still somewhere)...
comment:11 by , 12 years ago
Keywords: | history added |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Fixed for 2.0 in r10817. Final solution was the three case example above (plus one case for NULL raster = NULL convex hull)
Good question. For geometry ConvexHull(EMPTY) == EMPTY. The type of EMPTY (in geometry) is taken from the type of input, but I think that's pretty arbitrary. For Raster if you take the EMPTY path I'd use POLYGON EMPTY, as I think a raster's convexhull is _always_ polygonal in other cases, is that right ?