[postgis-devel] [PostGIS] #1402: [raster] ST_Resample producing incorrect transformation
PostGIS
trac at osgeo.org
Thu Dec 22 07:58:34 PST 2011
#1402: [raster] ST_Resample producing incorrect transformation
----------------------------+-----------------------------------------------
Reporter: dustymugs | Owner: dustymugs
Type: defect | Status: new
Priority: blocker | Milestone: PostGIS 2.0.0
Component: postgis raster | Version: trunk
Keywords: |
----------------------------+-----------------------------------------------
As per email [http://postgis.refractions.net/pipermail/postgis-
devel/2011-December/016960.html], ST_Resample is returning raster with
incorrect coordinates.
{{{
WITH
raster As (
SELECT ST_AddBand(ST_MakeEmptyRaster(100, 100, 195000, 450000, 1,
1, 0, 0, 28992),'32BUI') As rast
),
sub As (
SELECT ST_ConvexHull(ST_Resample(rast, 900913)) geom FROM raster
),
sub2 As (
SELECT ST_Transform(ST_ConvexHull(rast), 900913) geom FROM raster
)
SELECT 'st_resample' As class, ST_AsText(geom) FROM sub
UNION
SELECT 'st_transform' As class, ST_AsText(geom) From sub2
UNION
SELECT 'original' As class, ST_AsText(ST_ConvexHull(rast)) FROM raster
}}}
Double checking the upper-left corner coordinates with gdaltrasform proves
that something is amiss.
{{{gdaltransform -s_srs EPSG:28992 -t_srs "+proj=merc +a=6378137
+b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m
+nadgrids=@null +no_defs"
195000 450000
664595.851266449 6806797.3239794 43.5106153006745
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1402>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-devel
mailing list