Opened 11 years ago

Closed 11 years ago

Last modified 11 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: Bborie Park Owned by: Bborie Park
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 Bborie Park, 11 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 Bborie Park, 11 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, 11 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 Bborie Park, 11 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.