Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2119 closed enhancement (fixed)

[raster] use "substitute" SRS in RASTER_GDALWarp() when raster SRID = 0 AND function isn't being called to do a reprojection

Reported by: dustymugs Owned by: dustymugs
Priority: medium Milestone: PostGIS 2.1.0
Component: raster Version: master
Keywords: history Cc:

Description

When the GDAL Warp API is called with a raster that has no SRS, the API will error regardless of operation. But if a "garbage" SRS (completely valid SRS but not correct for the raster) is used, no error happens.

Testing was done on the gdalwarp utility using a raster with its correct SRS in addition to other "garbage" SRSes on resampling operations (no reprojection). Test results indicate that the output rasters are identical.

This usage of "garbage" SRS would only take place when RASTER_GDALWarp() is called with no output SRID, thereby nullifying any possibility of reprojection.

Change History (4)

comment:1 by dustymugs, 12 years ago

The end result of this special case is that ST_Resample(), ST_Rescale(), ST_Reskew() and ST_SnapToGrid() permits the use rasters with no spatial information (SRID = 0)

comment:2 by dustymugs, 12 years ago

Keywords: history added
Resolution: fixed
Status: newclosed
Summary: [raster] use "garbage" SRS in RASTER_GDALWarp() when raster SRID = 0 AND function isn't being called to do a reprojection[raster] use "substitute" SRS in RASTER_GDALWarp() when raster SRID = 0 AND function isn't being called to do a reprojection

Added in r10768

comment:3 by robe, 12 years ago

Is #1293 still necessary with this change. The only reason I needed resize was to get around the issue that I couldn't resize my purty land inspection pictures because they have no SRID but if resample now works without srid seems like a non-issue :)

comment:4 by dustymugs, 12 years ago

I'm going to say yes just because I'm almost done with ST_Resize() :-). Also, ST_Resample() is a big and bulky function (lots of possible arguments) while ST_Resize() is much simpler…

CREATE OR REPLACE FUNCTION st_resize(
	rast raster,
	width text, height text,
	algorithm text DEFAULT 'NearestNeighbour', maxerr double precision DEFAULT 0.125
)
Note: See TracTickets for help on using tickets.