Opened 15 years ago
Closed 15 years ago
#348 closed defect (fixed)
[wktraster] st_raster_envelope & st_raster_to_box2d return different results
Reported by: | pracine | Owned by: | pracine |
---|---|---|---|
Priority: | high | Milestone: | WKTRaster 0.1.6 |
Component: | raster | Version: | master |
Keywords: | Cc: |
Description (last modified by )
SELECT ST_AsText(st_raster_envelope(rast)) FROM mytable
UNION ALL
SELECT ST_AsText(st_raster_to_box2d(rast)) FROM mytable
should return two identical lines.
Change History (11)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Status: | new → assigned |
---|
comment:3 by , 15 years ago
Description: | modified (diff) |
---|
Reformated the query to make the two lines evident.
This bug appears when the coordinates of the center upper left pixel are very precises i.e. -85.750000033333492
A first problem is that the order is different.
A second problem is that the numbers are also different when the precision is high. I guess this problem is related to the fact that bbox are stored as float4s in PostGIS and our version of ST_Envelope returns the float8s version. I think we should return the float4s bbox. I have to test further though.
comment:5 by , 15 years ago
I've changed the name of ST_Raster_Envelope function for ST_ConvexHull, to match the specs: http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationWorking01#Objective0.1.6e-Beingabletointersectvectorandrastertoproducevector.
Commited in r5141
follow-up: 7 comment:6 by , 15 years ago
I've implemented the ST_Envelope function. The difference with ST_ConvexHull is the affine transformation performed in the case of ST_Envelope function doesn't take into account the rotation (so, only scale + traslation). Is it ok?
New ST_Envelope function committed in r5142
comment:7 by , 15 years ago
Replying to jorgearevalo:
I've implemented the ST_Envelope function. The difference with ST_ConvexHull is the affine transformation performed in the case of ST_Envelope function doesn't take into account the rotation (so, only scale + traslation). Is it ok?
New ST_Envelope function committed in r5142
I reply myself to note I should "floor" the raster coordinates on ST_Envelope before constructing the polygon, to add a little buffer around the raster.
comment:8 by , 15 years ago
Ok, this is not correct. I should rotate the raster and the get the min and max coordinates to construct the envelope. I'm sorry, I'll fix it.
comment:11 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The difference (WKT Raster Windows build by Regina from 2009-08-10 17:41:12) is as follows:
The two geometries are almost identical. The only difference is which is the first vertex, upper left vs lower left corner.
What does the "should return two identical lines" mean? Which line is the one that should be returned?