From: Bborie Park Date: Mon, 26 Nov 2012 19:13:04 +0000 (+0000) Subject: Renamed variants of ST_World2RasterCoord() and ST_Raster2WorldCoord() to X-Git-Tag: 2.1.0beta2~359 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b19048c556f92cb53ca1ba9417cbaae6aa985b4;p=postgis Renamed variants of ST_World2RasterCoord() and ST_Raster2WorldCoord() to ST_WorldToRasterCoord() and ST_RasterToWorldCoord() as names are inconsistent with other PostGIS function names. Ticket #2104 git-svn-id: http://svn.osgeo.org/postgis/trunk@10740 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/NEWS b/NEWS index 5f5a4cdca..87d0cf164 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,11 @@ PostGIS 2.1.0 Use ST_MapAlgebra instead - 1 and 2 raster variants of ST_MapAlgebraExpr. Use expression variants of ST_MapAlgebra instead + - #2104, ST_World2RasterCoord, ST_World2RasterCoordX and + ST_World2RasterCoordY renamed to ST_WorldToRasterCoord, + ST_WorldToRasterCoordX and ST_WorldToRasterCoordY. ST_Raster2WorldCoord, + ST_Raster2WorldCoordX and ST_Raster2WorldCoordY renamed to + ST_RasterToWorldCoord, ST_RasterToWorldCoordX and ST_RasterToWorldCoordY * New Features * diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml index 39f5bf910..8263044f8 100644 --- a/doc/reference_raster.xml +++ b/doc/reference_raster.xml @@ -2180,16 +2180,16 @@ FROM dummy_rast; - + - ST_Raster2WorldCoord + ST_RasterToWorldCoord Returns the raster's upper left corner as geometric X and Y (longitude and latitude) given a column and row. Column and row starts at 1. - record ST_Raster2WorldCoord + record ST_RasterToWorldCoord raster rast integer xcolumn integer yrow @@ -2216,8 +2216,8 @@ FROM dummy_rast; -- non-skewed raster SELECT rid, - (ST_Raster2WorldCoord(rast,1, 1)).*, - (ST_Raster2WorldCoord(rast,2, 2)).* + (ST_RasterToWorldCoord(rast,1, 1)).*, + (ST_RasterToWorldCoord(rast,2, 2)).* FROM dummy_rast rid | longitude | latitude | longitude | latitude @@ -2230,8 +2230,8 @@ FROM dummy_rast -- skewed raster SELECT rid, - (ST_Raster2WorldCoord(rast, 1, 1)).*, - (ST_Raster2WorldCoord(rast, 2, 3)).* + (ST_RasterToWorldCoord(rast, 1, 1)).*, + (ST_RasterToWorldCoord(rast, 2, 3)).* FROM ( SELECT rid, @@ -2251,16 +2251,16 @@ FROM ( See Also - , - , + , + , - + - ST_Raster2WorldCoordX + ST_RasterToWorldCoordX Returns the geometric X coordinate upper left of a raster, column and row. Numbering of columns and rows starts at 1. @@ -2268,12 +2268,12 @@ FROM ( - float8 ST_Raster2WorldCoordX + float8 ST_RasterToWorldCoordX raster rast integer xcolumn - float8 ST_Raster2WorldCoordX + float8 ST_RasterToWorldCoordX raster rast integer xcolumn integer yrow @@ -2292,6 +2292,9 @@ FROM ( For non-skewed rasters, providing the X column is sufficient. For skewed rasters, the georeferenced coordinate is a function of the ST_ScaleX and ST_SkewX and row and column. An error will be raised if you give just the X column for a skewed raster. + + Changed: 2.1.0 In prior versions, this was called ST_Raster2WorldCoordX + @@ -2299,8 +2302,8 @@ FROM ( -- non-skewed raster providing column is sufficient -SELECT rid, ST_Raster2WorldCoordX(rast,1) As x1coord, - ST_Raster2WorldCoordX(rast,2) As x2coord, +SELECT rid, ST_RasterToWorldCoordX(rast,1) As x1coord, + ST_RasterToWorldCoordX(rast,2) As x2coord, ST_ScaleX(rast) As pixelx FROM dummy_rast; @@ -2312,8 +2315,8 @@ FROM dummy_rast; -- for fun lets skew it -SELECT rid, ST_Raster2WorldCoordX(rast, 1, 1) As x1coord, - ST_Raster2WorldCoordX(rast, 2, 3) As x2coord, +SELECT rid, ST_RasterToWorldCoordX(rast, 1, 1) As x1coord, + ST_RasterToWorldCoordX(rast, 2, 3) As x2coord, ST_ScaleX(rast) As pixelx FROM (SELECT rid, ST_SetSkew(rast, 100.5, 0) As rast FROM dummy_rast) As foo; @@ -2328,13 +2331,13 @@ FROM (SELECT rid, ST_SetSkew(rast, 100.5, 0) As rast FROM dummy_rast) As foo; See Also - , , , + , , , - + - ST_Raster2WorldCoordY + ST_RasterToWorldCoordY Returns the geometric Y coordinate upper left corner of a raster, column and row. Numbering of columns and rows starts at 1. @@ -2342,12 +2345,12 @@ FROM (SELECT rid, ST_SetSkew(rast, 100.5, 0) As rast FROM dummy_rast) As foo; - float8 ST_Raster2WorldCoordY + float8 ST_RasterToWorldCoordY raster rast integer yrow - float8 ST_Raster2WorldCoordY + float8 ST_RasterToWorldCoordY raster rast integer xcolumn integer yrow @@ -2366,6 +2369,8 @@ FROM (SELECT rid, ST_SetSkew(rast, 100.5, 0) As rast FROM dummy_rast) As foo; For non-skewed rasters, providing the Y column is sufficient. For skewed rasters, the georeferenced coordinate is a function of the ST_ScaleY and ST_SkewY and row and column. An error will be raised if you give just the Y row for a skewed raster. + + Changed: 2.1.0 In prior versions, this was called ST_Raster2WorldCoordY @@ -2373,8 +2378,8 @@ FROM (SELECT rid, ST_SetSkew(rast, 100.5, 0) As rast FROM dummy_rast) As foo; -- non-skewed raster providing row is sufficient -SELECT rid, ST_Raster2WorldCoordY(rast,1) As y1coord, - ST_Raster2WorldCoordY(rast,3) As y2coord, +SELECT rid, ST_RasterToWorldCoordY(rast,1) As y1coord, + ST_RasterToWorldCoordY(rast,3) As y2coord, ST_ScaleY(rast) As pixely FROM dummy_rast; @@ -2386,8 +2391,8 @@ FROM dummy_rast; -- for fun lets skew it -SELECT rid, ST_Raster2WorldCoordY(rast,1,1) As y1coord, - ST_Raster2WorldCoordY(rast,2,3) As y2coord, +SELECT rid, ST_RasterToWorldCoordY(rast,1,1) As y1coord, + ST_RasterToWorldCoordY(rast,2,3) As y2coord, ST_ScaleY(rast) As pixely FROM (SELECT rid, ST_SetSkew(rast,0,100.5) As rast FROM dummy_rast) As foo; @@ -2402,7 +2407,7 @@ FROM (SELECT rid, ST_SetSkew(rast,0,100.5) As rast FROM dummy_rast) As foo; See Also - , , , + , , , @@ -2724,22 +2729,22 @@ rastwidth - + - ST_World2RasterCoord + ST_WorldToRasterCoord Returns the upper left corner as column and row given geometric X and Y (longitude and latitude) or a point geometry expressed in the spatial reference coordinate system of the raster. - integer ST_World2RasterCoord + integer ST_WorldToRasterCoord raster rast geometry pt - integer ST_World2RasterCoord + integer ST_WorldToRasterCoord raster rast double precision longitude double precision latitude @@ -2766,8 +2771,8 @@ rastwidth SELECT rid, - (ST_World2RasterCoord(rast,3427927.8,20.5)).*, - (ST_World2RasterCoord(rast,ST_GeomFromText('POINT(3427927.8 20.5)',ST_SRID(rast)))).* + (ST_WorldToRasterCoord(rast,3427927.8,20.5)).*, + (ST_WorldToRasterCoord(rast,ST_GeomFromText('POINT(3427927.8 20.5)',ST_SRID(rast)))).* FROM dummy_rast; rid | columnx | rowy | columnx | rowy @@ -2781,18 +2786,18 @@ FROM dummy_rast; See Also - , - , - , - , + , + , + , + , - + - ST_World2RasterCoordX + ST_WorldToRasterCoordX Returns the column in the raster of the point geometry (pt) or a X and Y world coordinate (xw, yw) represented in world spatial reference system of raster. @@ -2800,19 +2805,19 @@ FROM dummy_rast; - integer ST_World2RasterCoordX + integer ST_WorldToRasterCoordX raster rast geometry pt - integer ST_World2RasterCoordX + integer ST_WorldToRasterCoordX raster rast double precision xw - integer ST_World2RasterCoordX + integer ST_WorldToRasterCoordX raster rast double precision xw double precision yw @@ -2825,14 +2830,15 @@ FROM dummy_rast; Returns the column in the raster of the point geometry (pt) or a X and Y world coordinate (xw, yw). A point, or (both xw and yw world coordinates are required if a raster is skewed). If a raster is not skewed then xw is sufficient. World coordinates are in the spatial reference coordinate system of the raster. + Changed: 2.1.0 In prior versions, this was called ST_World2RasterCoordX Examples - SELECT rid, ST_World2RasterCoordX(rast,3427927.8) As xcoord, - ST_World2RasterCoordX(rast,3427927.8,20.5) As xcoord_xwyw, - ST_World2RasterCoordX(rast,ST_GeomFromText('POINT(3427927.8 20.5)',ST_SRID(rast))) As ptxcoord + SELECT rid, ST_WorldToRasterCoordX(rast,3427927.8) As xcoord, + ST_WorldToRasterCoordX(rast,3427927.8,20.5) As xcoord_xwyw, + ST_WorldToRasterCoordX(rast,ST_GeomFromText('POINT(3427927.8 20.5)',ST_SRID(rast))) As ptxcoord FROM dummy_rast; rid | xcoord | xcoord_xwyw | ptxcoord @@ -2846,16 +2852,16 @@ FROM dummy_rast; See Also - , - , + , + , - + - ST_World2RasterCoordY + ST_WorldToRasterCoordY Returns the row in the raster of the point geometry (pt) or a X and Y world coordinate (xw, yw) represented in world spatial reference system of raster. @@ -2863,19 +2869,19 @@ FROM dummy_rast; - integer ST_World2RasterCoordY + integer ST_WorldToRasterCoordY raster rast geometry pt - integer ST_World2RasterCoordY + integer ST_WorldToRasterCoordY raster rast double precision xw - integer ST_World2RasterCoordY + integer ST_WorldToRasterCoordY raster rast double precision xw double precision yw @@ -2888,14 +2894,15 @@ FROM dummy_rast; Returns the row in the raster of the point geometry (pt) or a X and Y world coordinate (xw, yw). A point, or (both xw and yw world coordinates are required if a raster is skewed). If a raster is not skewed then xw is sufficient. World coordinates are in the spatial reference coordinate system of the raster. + Changed: 2.1.0 In prior versions, this was called ST_World2RasterCoordY Examples - SELECT rid, ST_World2RasterCoordY(rast,20.5) As ycoord, - ST_World2RasterCoordY(rast,3427927.8,20.5) As ycoord_xwyw, - ST_World2RasterCoordY(rast,ST_GeomFromText('POINT(3427927.8 20.5)',ST_SRID(rast))) As ptycoord + SELECT rid, ST_WorldToRasterCoordY(rast,20.5) As ycoord, + ST_WorldToRasterCoordY(rast,3427927.8,20.5) As ycoord_xwyw, + ST_WorldToRasterCoordY(rast,ST_GeomFromText('POINT(3427927.8 20.5)',ST_SRID(rast))) As ptycoord FROM dummy_rast; rid | ycoord | ycoord_xwyw | ptycoord @@ -2908,7 +2915,7 @@ FROM dummy_rast; See Also - , , + , , diff --git a/raster/rt_pg/rtpostgis.sql.in.c b/raster/rt_pg/rtpostgis.sql.in.c index 41f9a36df..c98f9635f 100644 --- a/raster/rt_pg/rtpostgis.sql.in.c +++ b/raster/rt_pg/rtpostgis.sql.in.c @@ -3978,8 +3978,8 @@ CREATE OR REPLACE FUNCTION st_value(rast raster, band integer, pt geometry, excl y := st_y(pt); RETURN st_value(rast, band, - st_world2rastercoordx(rast, x, y), - st_world2rastercoordy(rast, x, y), + st_worldtorastercoordx(rast, x, y), + st_worldtorastercoordy(rast, x, y), exclude_nodata_value); END; $$ @@ -4510,10 +4510,10 @@ CREATE OR REPLACE FUNCTION st_pixelascentroid(rast raster, x integer, y integer) ----------------------------------------------------------------------- ----------------------------------------------------------------------- --- ST_World2RasterCoord +-- ST_WorldToRasterCoord ----------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION _st_world2rastercoord( +CREATE OR REPLACE FUNCTION _st_worldtorastercoord( rast raster, longitude double precision DEFAULT NULL, latitude double precision DEFAULT NULL, OUT columnx integer, @@ -4523,26 +4523,26 @@ CREATE OR REPLACE FUNCTION _st_world2rastercoord( LANGUAGE 'c' IMMUTABLE; --------------------------------------------------------------------------------- --- ST_World2RasterCoord(rast raster, longitude float8, latitude float8) +-- ST_WorldToRasterCoord(rast raster, longitude float8, latitude float8) -- Returns the pixel column and row covering the provided X and Y world -- coordinates. -- This function works even if the world coordinates are outside the raster extent. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_world2rastercoord( +CREATE OR REPLACE FUNCTION st_worldtorastercoord( rast raster, longitude double precision, latitude double precision, OUT columnx integer, OUT rowy integer ) - AS $$ SELECT columnx, rowy FROM _st_world2rastercoord($1, $2, $3) $$ + AS $$ SELECT columnx, rowy FROM _st_worldtorastercoord($1, $2, $3) $$ LANGUAGE 'sql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_World2RasterCoordX(rast raster, pt geometry) +-- ST_WorldToRasterCoordX(rast raster, pt geometry) -- Returns the pixel column and row covering the provided point geometry. -- This function works even if the point is outside the raster extent. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_world2rastercoord( +CREATE OR REPLACE FUNCTION st_worldtorastercoord( rast raster, pt geometry, OUT columnx integer, OUT rowy integer @@ -4560,42 +4560,42 @@ CREATE OR REPLACE FUNCTION st_world2rastercoord( RAISE EXCEPTION 'Raster and geometry do not have the same SRID'; END IF; - SELECT rc.columnx AS x, rc.rowy AS y INTO columnx, rowy FROM _st_world2rastercoord($1, st_x(pt), st_y(pt)) AS rc; + SELECT rc.columnx AS x, rc.rowy AS y INTO columnx, rowy FROM _st_worldtorastercoord($1, st_x(pt), st_y(pt)) AS rc; RETURN; END; $$ LANGUAGE 'plpgsql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_World2RasterCoordX(rast raster, xw float8, yw float8) +-- ST_WorldToRasterCoordX(rast raster, xw float8, yw float8) -- Returns the column number of the pixel covering the provided X and Y world -- coordinates. -- This function works even if the world coordinates are outside the raster extent. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_world2rastercoordx(rast raster, xw float8, yw float8) +CREATE OR REPLACE FUNCTION st_worldtorastercoordx(rast raster, xw float8, yw float8) RETURNS int - AS $$ SELECT columnx FROM _st_world2rastercoord($1, $2, $3) $$ + AS $$ SELECT columnx FROM _st_worldtorastercoord($1, $2, $3) $$ LANGUAGE 'sql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_World2RasterCoordX(rast raster, xw float8) +-- ST_WorldToRasterCoordX(rast raster, xw float8) -- Returns the column number of the pixels covering the provided world X coordinate -- for a non-rotated raster. -- This function works even if the world coordinate is outside the raster extent. -- This function returns an error if the raster is rotated. In this case you must -- also provide a Y. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_world2rastercoordx(rast raster, xw float8) +CREATE OR REPLACE FUNCTION st_worldtorastercoordx(rast raster, xw float8) RETURNS int - AS $$ SELECT columnx FROM _st_world2rastercoord($1, $2, NULL) $$ + AS $$ SELECT columnx FROM _st_worldtorastercoord($1, $2, NULL) $$ LANGUAGE 'sql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_World2RasterCoordX(rast raster, pt geometry) +-- ST_WorldToRasterCoordX(rast raster, pt geometry) -- Returns the column number of the pixel covering the provided point geometry. -- This function works even if the point is outside the raster extent. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_world2rastercoordx(rast raster, pt geometry) +CREATE OR REPLACE FUNCTION st_worldtorastercoordx(rast raster, pt geometry) RETURNS int AS $$ DECLARE @@ -4607,42 +4607,42 @@ CREATE OR REPLACE FUNCTION st_world2rastercoordx(rast raster, pt geometry) IF ST_SRID(rast) != ST_SRID(pt) THEN RAISE EXCEPTION 'Raster and geometry do not have the same SRID'; END IF; - SELECT columnx INTO xr FROM _st_world2rastercoord($1, st_x(pt), st_y(pt)); + SELECT columnx INTO xr FROM _st_worldtorastercoord($1, st_x(pt), st_y(pt)); RETURN xr; END; $$ LANGUAGE 'plpgsql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_World2RasterCoordY(rast raster, xw float8, yw float8) +-- ST_WorldToRasterCoordY(rast raster, xw float8, yw float8) -- Returns the row number of the pixel covering the provided X and Y world -- coordinates. -- This function works even if the world coordinates are outside the raster extent. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_world2rastercoordy(rast raster, xw float8, yw float8) +CREATE OR REPLACE FUNCTION st_worldtorastercoordy(rast raster, xw float8, yw float8) RETURNS int - AS $$ SELECT rowy FROM _st_world2rastercoord($1, $2, $3) $$ + AS $$ SELECT rowy FROM _st_worldtorastercoord($1, $2, $3) $$ LANGUAGE 'sql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_World2RasterCoordY(rast raster, yw float8) +-- ST_WorldToRasterCoordY(rast raster, yw float8) -- Returns the row number of the pixels covering the provided world Y coordinate -- for a non-rotated raster. -- This function works even if the world coordinate is outside the raster extent. -- This function returns an error if the raster is rotated. In this case you must -- also provide an X. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_world2rastercoordy(rast raster, yw float8) +CREATE OR REPLACE FUNCTION st_worldtorastercoordy(rast raster, yw float8) RETURNS int - AS $$ SELECT rowy FROM _st_world2rastercoord($1, NULL, $2) $$ + AS $$ SELECT rowy FROM _st_worldtorastercoord($1, NULL, $2) $$ LANGUAGE 'sql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_World2RasterCoordY(rast raster, pt geometry) +-- ST_WorldToRasterCoordY(rast raster, pt geometry) -- Returns the row number of the pixel covering the provided point geometry. -- This function works even if the point is outside the raster extent. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_world2rastercoordy(rast raster, pt geometry) +CREATE OR REPLACE FUNCTION st_worldtorastercoordy(rast raster, pt geometry) RETURNS int AS $$ DECLARE @@ -4654,17 +4654,17 @@ CREATE OR REPLACE FUNCTION st_world2rastercoordy(rast raster, pt geometry) IF ST_SRID(rast) != ST_SRID(pt) THEN RAISE EXCEPTION 'Raster and geometry do not have the same SRID'; END IF; - SELECT rowy INTO yr FROM _st_world2rastercoord($1, st_x(pt), st_y(pt)); + SELECT rowy INTO yr FROM _st_worldtorastercoord($1, st_x(pt), st_y(pt)); RETURN yr; END; $$ LANGUAGE 'plpgsql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_Raster2WorldCoord +-- ST_RasterToWorldCoord --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION _st_raster2worldcoord( +CREATE OR REPLACE FUNCTION _st_rastertoworldcoord( rast raster, columnx integer DEFAULT NULL, rowy integer DEFAULT NULL, OUT longitude double precision, @@ -4674,35 +4674,35 @@ CREATE OR REPLACE FUNCTION _st_raster2worldcoord( LANGUAGE 'c' IMMUTABLE; --------------------------------------------------------------------------------- --- ST_Raster2WorldCoordX(rast raster, xr int, yr int) +-- ST_RasterToWorldCoordX(rast raster, xr int, yr int) -- Returns the longitude and latitude of the upper left corner of the pixel -- located at the provided pixel column and row. -- This function works even if the provided raster column and row are beyond or -- below the raster width and height. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_raster2worldcoord( +CREATE OR REPLACE FUNCTION st_rastertoworldcoord( rast raster, columnx integer, rowy integer, OUT longitude double precision, OUT latitude double precision ) - AS $$ SELECT longitude, latitude FROM _st_raster2worldcoord($1, $2, $3) $$ + AS $$ SELECT longitude, latitude FROM _st_rastertoworldcoord($1, $2, $3) $$ LANGUAGE 'sql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_Raster2WorldCoordX(rast raster, xr int, yr int) +-- ST_RasterToWorldCoordX(rast raster, xr int, yr int) -- Returns the X world coordinate of the upper left corner of the pixel located at -- the provided column and row numbers. -- This function works even if the provided raster column and row are beyond or -- below the raster width and height. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_raster2worldcoordx(rast raster, xr int, yr int) +CREATE OR REPLACE FUNCTION st_rastertoworldcoordx(rast raster, xr int, yr int) RETURNS float8 - AS $$ SELECT longitude FROM _st_raster2worldcoord($1, $2, $3) $$ + AS $$ SELECT longitude FROM _st_rastertoworldcoord($1, $2, $3) $$ LANGUAGE 'sql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_Raster2WorldCoordX(rast raster, xr int) +-- ST_RasterToWorldCoordX(rast raster, xr int) -- Returns the X world coordinate of the upper left corner of the pixel located at -- the provided column number for a non-rotated raster. -- This function works even if the provided raster column is beyond or below the @@ -4710,25 +4710,25 @@ CREATE OR REPLACE FUNCTION st_raster2worldcoordx(rast raster, xr int, yr int) -- This function returns an error if the raster is rotated. In this case you must -- also provide a Y. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_raster2worldcoordx(rast raster, xr int) +CREATE OR REPLACE FUNCTION st_rastertoworldcoordx(rast raster, xr int) RETURNS float8 - AS $$ SELECT longitude FROM _st_raster2worldcoord($1, $2, NULL) $$ + AS $$ SELECT longitude FROM _st_rastertoworldcoord($1, $2, NULL) $$ LANGUAGE 'sql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_Raster2WorldCoordY(rast raster, xr int, yr int) +-- ST_RasterToWorldCoordY(rast raster, xr int, yr int) -- Returns the Y world coordinate of the upper left corner of the pixel located at -- the provided column and row numbers. -- This function works even if the provided raster column and row are beyond or -- below the raster width and height. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_raster2worldcoordy(rast raster, xr int, yr int) +CREATE OR REPLACE FUNCTION st_rastertoworldcoordy(rast raster, xr int, yr int) RETURNS float8 - AS $$ SELECT latitude FROM _st_raster2worldcoord($1, $2, $3) $$ + AS $$ SELECT latitude FROM _st_rastertoworldcoord($1, $2, $3) $$ LANGUAGE 'sql' IMMUTABLE STRICT; --------------------------------------------------------------------------------- --- ST_Raster2WorldCoordY(rast raster, yr int) +-- ST_RasterToWorldCoordY(rast raster, yr int) -- Returns the Y world coordinate of the upper left corner of the pixel located at -- the provided row number for a non-rotated raster. -- This function works even if the provided raster row is beyond or below the @@ -4736,9 +4736,9 @@ CREATE OR REPLACE FUNCTION st_raster2worldcoordy(rast raster, xr int, yr int) -- This function returns an error if the raster is rotated. In this case you must -- also provide an X. --------------------------------------------------------------------------------- -CREATE OR REPLACE FUNCTION st_raster2worldcoordy(rast raster, yr int) +CREATE OR REPLACE FUNCTION st_rastertoworldcoordy(rast raster, yr int) RETURNS float8 - AS $$ SELECT latitude FROM _st_raster2worldcoord($1, NULL, $2) $$ + AS $$ SELECT latitude FROM _st_rastertoworldcoord($1, NULL, $2) $$ LANGUAGE 'sql' IMMUTABLE STRICT; ----------------------------------------------------------------------- @@ -5161,14 +5161,14 @@ CREATE OR REPLACE FUNCTION _st_intersects(geom geometry, rast raster, nband inte --RAISE NOTICE 'x1w=%, y1w=%, x2w=%, y2w=%', x1w, y1w, x2w, y2w; -- Convert world coordinates to raster coordinates - x1 := st_world2rastercoordx(rast, x1w, y1w); - y1 := st_world2rastercoordy(rast, x1w, y1w); - x2 := st_world2rastercoordx(rast, x2w, y1w); - y2 := st_world2rastercoordy(rast, x2w, y1w); - x3 := st_world2rastercoordx(rast, x1w, y2w); - y3 := st_world2rastercoordy(rast, x1w, y2w); - x4 := st_world2rastercoordx(rast, x2w, y2w); - y4 := st_world2rastercoordy(rast, x2w, y2w); + x1 := st_worldtorastercoordx(rast, x1w, y1w); + y1 := st_worldtorastercoordy(rast, x1w, y1w); + x2 := st_worldtorastercoordx(rast, x2w, y1w); + y2 := st_worldtorastercoordy(rast, x2w, y1w); + x3 := st_worldtorastercoordx(rast, x1w, y2w); + y3 := st_worldtorastercoordy(rast, x1w, y2w); + x4 := st_worldtorastercoordx(rast, x2w, y2w); + y4 := st_worldtorastercoordy(rast, x2w, y2w); --RAISE NOTICE 'x1=%, y1=%, x2=%, y2=%, x3=%, y3=%, x4=%, y4=%', x1, y1, x2, y2, x3, y3, x4, y4; @@ -5774,7 +5774,7 @@ CREATE OR REPLACE FUNCTION st_nearestvalue( exclude_nodata_value boolean DEFAULT TRUE ) RETURNS double precision - AS $$ SELECT st_nearestvalue($1, $2, st_setsrid(st_makepoint(st_raster2worldcoordx($1, $3, $4), st_raster2worldcoordy($1, $3, $4)), st_srid($1)), $5) $$ + AS $$ SELECT st_nearestvalue($1, $2, st_setsrid(st_makepoint(st_rastertoworldcoordx($1, $3, $4), st_rastertoworldcoordy($1, $3, $4)), st_srid($1)), $5) $$ LANGUAGE 'sql' IMMUTABLE STRICT; CREATE OR REPLACE FUNCTION st_nearestvalue( @@ -5783,7 +5783,7 @@ CREATE OR REPLACE FUNCTION st_nearestvalue( exclude_nodata_value boolean DEFAULT TRUE ) RETURNS double precision - AS $$ SELECT st_nearestvalue($1, 1, st_setsrid(st_makepoint(st_raster2worldcoordx($1, $2, $3), st_raster2worldcoordy($1, $2, $3)), st_srid($1)), $4) $$ + AS $$ SELECT st_nearestvalue($1, 1, st_setsrid(st_makepoint(st_rastertoworldcoordx($1, $2, $3), st_rastertoworldcoordy($1, $2, $3)), st_srid($1)), $4) $$ LANGUAGE 'sql' IMMUTABLE STRICT; ----------------------------------------------------------------------- @@ -5846,8 +5846,8 @@ CREATE OR REPLACE FUNCTION st_neighborhood( SELECT _st_neighborhood( $1, $2, - st_world2rastercoordx(rast, wx, wy), - st_world2rastercoordy(rast, wx, wy), + st_worldtorastercoordx(rast, wx, wy), + st_worldtorastercoordy(rast, wx, wy), $4, $5, $6 ) INTO rtn; diff --git a/raster/rt_pg/rtpostgis_drop.sql.in.c b/raster/rt_pg/rtpostgis_drop.sql.in.c index ef8d56d7d..9facaa34e 100644 --- a/raster/rt_pg/rtpostgis_drop.sql.in.c +++ b/raster/rt_pg/rtpostgis_drop.sql.in.c @@ -356,8 +356,8 @@ DROP FUNCTION IF EXISTS st_intersects(raster, integer, raster, integer); DROP FUNCTION IF EXISTS st_intersects(raster, raster); -- functions have changed dramatically -DROP FUNCTION IF EXISTS st_intersection(rast raster, band integer, geom geometry); -DROP FUNCTION IF EXISTS st_intersection(rast raster, geom geometry); +DROP FUNCTION IF EXISTS st_intersection(raster, integer, geometry); +DROP FUNCTION IF EXISTS st_intersection(raster, geometry); -- function was renamed DROP FUNCTION IF EXISTS st_minpossibleval(text); @@ -450,3 +450,20 @@ DROP FUNCTION IF EXISTS st_tile(raster, integer, integer, integer); -- function signatures changed DROP FUNCTION IF EXISTS st_setvalue(raster, integer, geometry, double precision); DROP FUNCTION IF EXISTS st_setvalue(raster, geometry, double precision); + +-- function name change +DROP FUNCTION IF EXISTS st_world2rastercoord(raster, double precision, double precision); +DROP FUNCTION IF EXISTS st_world2rastercoord(raster, geometry); +DROP FUNCTION IF EXISTS _st_world2rastercoord(raster, double precision, double precision); +DROP FUNCTION IF EXISTS st_world2rastercoordx(raster, float8, float8); +DROP FUNCTION IF EXISTS st_world2rastercoordx(raster, float8); +DROP FUNCTION IF EXISTS st_world2rastercoordx(raster, geometry); +DROP FUNCTION IF EXISTS st_world2rastercoordy(raster, float8, float8); +DROP FUNCTION IF EXISTS st_world2rastercoordy(raster, float8); +DROP FUNCTION IF EXISTS st_world2rastercoordy(raster, geometry); +DROP FUNCTION IF EXISTS st_raster2worldcoord( raster, integer, integer); +DROP FUNCTION IF EXISTS _st_raster2worldcoord(raster, integer, integer); +DROP FUNCTION IF EXISTS st_raster2worldcoordx(raster, int, int); +DROP FUNCTION IF EXISTS st_raster2worldcoordx(raster, int); +DROP FUNCTION IF EXISTS st_raster2worldcoordy(raster, int, int); +DROP FUNCTION IF EXISTS st_raster2worldcoordy(raster, int); diff --git a/raster/test/regress/Makefile.in b/raster/test/regress/Makefile.in index 94074c595..0fec54de3 100644 --- a/raster/test/regress/Makefile.in +++ b/raster/test/regress/Makefile.in @@ -57,8 +57,8 @@ TEST_PROPS = \ rt_isempty \ rt_hasnoband \ rt_metadata \ - rt_raster2worldcoord \ - rt_world2rastercoord + rt_rastertoworldcoord \ + rt_worldtorastercoord TEST_BANDPROPS = \ rt_band_properties \ diff --git a/raster/test/regress/rt_pixelascentroids.sql b/raster/test/regress/rt_pixelascentroids.sql index f550e95e9..c8065f2bc 100644 --- a/raster/test/regress/rt_pixelascentroids.sql +++ b/raster/test/regress/rt_pixelascentroids.sql @@ -34,8 +34,8 @@ DROP FUNCTION make_test_raster(); SELECT (pix).x, (pix).y, - ST_Raster2WorldCoordX(rast, (pix).x, (pix).y), - ST_Raster2WorldCoordY(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordX(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordY(rast, (pix).x, (pix).y), (pix).val, ST_AsText((pix).geom) FROM (SELECT rast, ST_PixelAsCentroids(rast) AS pix FROM raster_pixelascentroids) foo @@ -44,8 +44,8 @@ ORDER BY 1, 2, 3, 4, 6; SELECT (pix).x, (pix).y, - ST_Raster2WorldCoordX(rast, (pix).x, (pix).y), - ST_Raster2WorldCoordY(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordX(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordY(rast, (pix).x, (pix).y), (pix).val, ST_AsText((pix).geom) FROM (SELECT rast, ST_PixelAsCentroids(rast, NULL) AS pix FROM raster_pixelascentroids) foo @@ -54,8 +54,8 @@ ORDER BY 1, 2, 3, 4, 6; SELECT (pix).x, (pix).y, - ST_Raster2WorldCoordX(rast, (pix).x, (pix).y), - ST_Raster2WorldCoordY(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordX(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordY(rast, (pix).x, (pix).y), (pix).val, ST_AsText((pix).geom) FROM (SELECT rast, ST_PixelAsCentroids(rast, 1, FALSE) AS pix FROM raster_pixelascentroids) foo diff --git a/raster/test/regress/rt_pixelaspoints.sql b/raster/test/regress/rt_pixelaspoints.sql index 8a73f8098..6faf1f0b7 100644 --- a/raster/test/regress/rt_pixelaspoints.sql +++ b/raster/test/regress/rt_pixelaspoints.sql @@ -34,8 +34,8 @@ DROP FUNCTION make_test_raster(); SELECT (pix).x, (pix).y, - ST_Raster2WorldCoordX(rast, (pix).x, (pix).y), - ST_Raster2WorldCoordY(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordX(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordY(rast, (pix).x, (pix).y), (pix).val, ST_AsText((pix).geom) FROM (SELECT rast, ST_PixelAsPoints(rast) AS pix FROM raster_pixelaspoints) foo @@ -44,8 +44,8 @@ ORDER BY 1, 2, 3, 4, 6; SELECT (pix).x, (pix).y, - ST_Raster2WorldCoordX(rast, (pix).x, (pix).y), - ST_Raster2WorldCoordY(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordX(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordY(rast, (pix).x, (pix).y), (pix).val, ST_AsText((pix).geom) FROM (SELECT rast, ST_PixelAsPoints(rast, NULL) AS pix FROM raster_pixelaspoints) foo @@ -54,8 +54,8 @@ ORDER BY 1, 2, 3, 4, 6; SELECT (pix).x, (pix).y, - ST_Raster2WorldCoordX(rast, (pix).x, (pix).y), - ST_Raster2WorldCoordY(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordX(rast, (pix).x, (pix).y), + ST_RasterToWorldCoordY(rast, (pix).x, (pix).y), (pix).val, ST_AsText((pix).geom) FROM (SELECT rast, ST_PixelAsPoints(rast, 1, FALSE) AS pix FROM raster_pixelaspoints) foo diff --git a/raster/test/regress/rt_raster2worldcoord.sql b/raster/test/regress/rt_rastertoworldcoord.sql similarity index 72% rename from raster/test/regress/rt_raster2worldcoord.sql rename to raster/test/regress/rt_rastertoworldcoord.sql index 590614295..91e26d204 100644 --- a/raster/test/regress/rt_raster2worldcoord.sql +++ b/raster/test/regress/rt_rastertoworldcoord.sql @@ -47,107 +47,107 @@ DROP FUNCTION make_test_raster(integer, integer, integer, double precision, doub SELECT rid, - (ST_Raster2WorldCoord(rast, 1, 1)).* + (ST_RasterToWorldCoord(rast, 1, 1)).* FROM raster_raster2world; SELECT rid, - (ST_Raster2WorldCoord(rast, 1, 2)).* + (ST_RasterToWorldCoord(rast, 1, 2)).* FROM raster_raster2world; SELECT rid, - (ST_Raster2WorldCoord(rast, 2, 2)).* + (ST_RasterToWorldCoord(rast, 2, 2)).* FROM raster_raster2world; SELECT rid, - (ST_Raster2WorldCoord(rast, 0, 0)).* + (ST_RasterToWorldCoord(rast, 0, 0)).* FROM raster_raster2world; SELECT rid, - (ST_Raster2WorldCoord(rast, -1, 0)).* + (ST_RasterToWorldCoord(rast, -1, 0)).* FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordX(rast, 1, 1) + ST_RasterToWorldCoordX(rast, 1, 1) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordX(rast, 1, 2) + ST_RasterToWorldCoordX(rast, 1, 2) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordX(rast, 2, 2) + ST_RasterToWorldCoordX(rast, 2, 2) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordX(rast, 0, 0) + ST_RasterToWorldCoordX(rast, 0, 0) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordX(rast, -1, 0) + ST_RasterToWorldCoordX(rast, -1, 0) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordX(rast, 1) + ST_RasterToWorldCoordX(rast, 1) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordX(rast, 1) + ST_RasterToWorldCoordX(rast, 1) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordX(rast, 2) + ST_RasterToWorldCoordX(rast, 2) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordX(rast, 0) + ST_RasterToWorldCoordX(rast, 0) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordX(rast, -1) + ST_RasterToWorldCoordX(rast, -1) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordY(rast, 1, 1) + ST_RasterToWorldCoordY(rast, 1, 1) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordY(rast, 1, 2) + ST_RasterToWorldCoordY(rast, 1, 2) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordY(rast, 2, 2) + ST_RasterToWorldCoordY(rast, 2, 2) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordY(rast, 0, 0) + ST_RasterToWorldCoordY(rast, 0, 0) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordY(rast, -1, 0) + ST_RasterToWorldCoordY(rast, -1, 0) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordY(rast, 1) + ST_RasterToWorldCoordY(rast, 1) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordY(rast, 1) + ST_RasterToWorldCoordY(rast, 1) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordY(rast, 2) + ST_RasterToWorldCoordY(rast, 2) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordY(rast, 0) + ST_RasterToWorldCoordY(rast, 0) FROM raster_raster2world; SELECT rid, - ST_Raster2WorldCoordY(rast, -1) + ST_RasterToWorldCoordY(rast, -1) FROM raster_raster2world; DROP TABLE raster_raster2world; diff --git a/raster/test/regress/rt_raster2worldcoord_expected b/raster/test/regress/rt_rastertoworldcoord_expected similarity index 100% rename from raster/test/regress/rt_raster2worldcoord_expected rename to raster/test/regress/rt_rastertoworldcoord_expected diff --git a/raster/test/regress/rt_utility.sql b/raster/test/regress/rt_utility.sql index 2b5142f8f..813822d3b 100644 --- a/raster/test/regress/rt_utility.sql +++ b/raster/test/regress/rt_utility.sql @@ -147,68 +147,68 @@ VALUES ( 4, '6000x6000, ip:-75.5533328537098,49.2824585505576 scale:0.0008059652 ); ----------------------------------------------------------------------- --- Test 1 - st_world2rastercoordx(rast raster, xw float8, yw float8) +-- Test 1 - ST_WorldTorastercoordx(rast raster, xw float8, yw float8) ----------------------------------------------------------------------- SELECT 'test 1.1', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordx(rast, + WHERE COALESCE(ST_WorldTorastercoordx(rast, ipx, ipy ), 0) != 1; SELECT 'test 1.2', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordx(rast, + WHERE COALESCE(ST_WorldTorastercoordx(rast, scalex * (width - 1) + skewx * (height - 1) + ipx, skewy * (width - 1) + scaley * (height - 1) + ipy ), 0) != width; SELECT 'test 1.3', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordx(rast, + WHERE COALESCE(ST_WorldTorastercoordx(rast, scalex * width + skewx * height + ipx, skewy * width + scaley * height + ipy ), 0) != width + 1; ----------------------------------------------------------------------- --- Test 2 - st_world2rastercoordx(rast raster, xw float8) +-- Test 2 - ST_WorldTorastercoordx(rast raster, xw float8) ----------------------------------------------------------------------- SELECT 'test 2.1', id, name FROM rt_utility_test WHERE skewx = 0 and - COALESCE(st_world2rastercoordx(rast, + COALESCE(ST_WorldTorastercoordx(rast, ipx ), 0) != 1; SELECT 'test 2.2', id, name FROM rt_utility_test WHERE skewx = 0 and - COALESCE(st_world2rastercoordx(rast, + COALESCE(ST_WorldTorastercoordx(rast, scalex * (width - 1) + ipx ), 0) != width; SELECT 'test 2.3', id, name FROM rt_utility_test WHERE skewx = 0 and - COALESCE(st_world2rastercoordx(rast, + COALESCE(ST_WorldTorastercoordx(rast, scalex * width + ipx ), 0) != width + 1; SELECT 'test 2.4', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordx(rast, + WHERE COALESCE(ST_WorldTorastercoordx(rast, ipx ), 0) != 1; ----------------------------------------------------------------------- --- Test 3 - st_world2rastercoordx(rast raster, pt geometry) +-- Test 3 - ST_WorldTorastercoordx(rast raster, pt geometry) ----------------------------------------------------------------------- SELECT 'test 3.1', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordx(rast, + WHERE COALESCE(ST_WorldTorastercoordx(rast, st_makepoint( ipx, ipy @@ -217,7 +217,7 @@ SELECT 'test 3.1', id, name SELECT 'test 3.2', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordx(rast, + WHERE COALESCE(ST_WorldTorastercoordx(rast, st_makepoint( scalex * (width - 1) + skewx * (height - 1) + ipx, skewy * (width - 1) + scaley * (height - 1) + ipy @@ -226,7 +226,7 @@ SELECT 'test 3.2', id, name SELECT 'test 3.3', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordx(rast, + WHERE COALESCE(ST_WorldTorastercoordx(rast, st_makepoint( scalex * width + skewx * height + ipx, skewy * width + scaley * height + ipy @@ -234,69 +234,69 @@ SELECT 'test 3.3', id, name ), 0) != width + 1; ----------------------------------------------------------------------- --- Test 4 - st_world2rastercoordy(rast raster, xw float8, yw float8) +-- Test 4 - ST_WorldTorastercoordy(rast raster, xw float8, yw float8) ----------------------------------------------------------------------- SELECT 'test 4.1', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordy(rast, + WHERE COALESCE(ST_WorldTorastercoordy(rast, ipx, ipy ), 0) != 1; SELECT 'test 4.2', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordy(rast, + WHERE COALESCE(ST_WorldTorastercoordy(rast, scalex * (width - 1) + skewx * (height - 1) + ipx, skewy * (width - 1) + scaley * (height - 1) + ipy ), 0) != height; SELECT 'test 4.3', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordy(rast, + WHERE COALESCE(ST_WorldTorastercoordy(rast, scalex * width + skewx * height + ipx, skewy * width + scaley * height + ipy ), 0) != height + 1; ----------------------------------------------------------------------- --- Test 5 - st_world2rastercoordy(rast raster, yw float8) +-- Test 5 - ST_WorldTorastercoordy(rast raster, yw float8) ----------------------------------------------------------------------- SELECT 'test 5.1', id, name FROM rt_utility_test WHERE skewy = 0 and - COALESCE(st_world2rastercoordy(rast, + COALESCE(ST_WorldTorastercoordy(rast, ipy ), 0) != 1; SELECT 'test 5.2', id, name FROM rt_utility_test WHERE skewy = 0 and - COALESCE(st_world2rastercoordy(rast, + COALESCE(ST_WorldTorastercoordy(rast, scaley * (height - 1) + ipy ), 0) != height; SELECT 'test 5.3', id, name FROM rt_utility_test WHERE skewy = 0 and - COALESCE(st_world2rastercoordy(rast, + COALESCE(ST_WorldTorastercoordy(rast, scaley * height + ipy ), 0) != height + 1; SELECT 'test 5.4', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordy(rast, + WHERE COALESCE(ST_WorldTorastercoordy(rast, ipy ), 0) != 1; ----------------------------------------------------------------------- --- Test 6 - st_world2rastercoordy(rast raster, pt geometry) +-- Test 6 - ST_WorldTorastercoordy(rast raster, pt geometry) ----------------------------------------------------------------------- SELECT 'test 6.1', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordy(rast, + WHERE COALESCE(ST_WorldTorastercoordy(rast, st_makepoint( ipx, ipy @@ -305,7 +305,7 @@ SELECT 'test 6.1', id, name SELECT 'test 6.2', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordy(rast, + WHERE COALESCE(ST_WorldTorastercoordy(rast, st_makepoint( scalex * (width - 1) + skewx * (height - 1) + ipx, skewy * (width - 1) + scaley * (height - 1) + ipy @@ -314,7 +314,7 @@ SELECT 'test 6.2', id, name SELECT 'test 6.3', id, name FROM rt_utility_test - WHERE COALESCE(st_world2rastercoordy(rast, + WHERE COALESCE(ST_WorldTorastercoordy(rast, st_makepoint( scalex * width + skewx * height + ipx, skewy * width + scaley * height + ipy @@ -322,60 +322,60 @@ SELECT 'test 6.3', id, name ), 0) != height + 1; ----------------------------------------------------------------------- --- Test 7 - st_raster2worldcoordx(rast raster, xr int, yr int) +-- Test 7 - ST_RasterToworldcoordx(rast raster, xr int, yr int) ----------------------------------------------------------------------- SELECT 'test 7.1', id, name FROM rt_utility_test - WHERE COALESCE(st_raster2worldcoordx(rast, 1, 1), 0)::numeric != ipx::numeric; + WHERE COALESCE(ST_RasterToworldcoordx(rast, 1, 1), 0)::numeric != ipx::numeric; SELECT 'test 7.2', id, name FROM rt_utility_test - WHERE COALESCE(st_raster2worldcoordx(rast, width, height), 0)::numeric != (scalex * (width - 1) + skewx * (height - 1) + ipx)::numeric; + WHERE COALESCE(ST_RasterToworldcoordx(rast, width, height), 0)::numeric != (scalex * (width - 1) + skewx * (height - 1) + ipx)::numeric; ----------------------------------------------------------------------- --- Test 8 - st_raster2worldcoordx(rast raster, xr int) +-- Test 8 - ST_RasterToworldcoordx(rast raster, xr int) ----------------------------------------------------------------------- SELECT 'test 8.1', id, name FROM rt_utility_test - WHERE skewx = 0 and COALESCE(st_raster2worldcoordx(rast, 1), 0)::numeric != ipx::numeric; + WHERE skewx = 0 and COALESCE(ST_RasterToworldcoordx(rast, 1), 0)::numeric != ipx::numeric; SELECT 'test 8.2', id, name FROM rt_utility_test - WHERE skewx = 0 and COALESCE(st_raster2worldcoordx(rast, width), 0)::numeric != (scalex * (width - 1) + ipx)::numeric; + WHERE skewx = 0 and COALESCE(ST_RasterToworldcoordx(rast, width), 0)::numeric != (scalex * (width - 1) + ipx)::numeric; SELECT 'test 8.3', id, name FROM rt_utility_test - WHERE COALESCE(st_raster2worldcoordx(rast, 1), 0)::numeric != ipx::numeric; + WHERE COALESCE(ST_RasterToworldcoordx(rast, 1), 0)::numeric != ipx::numeric; ----------------------------------------------------------------------- --- Test 9 - st_raster2worldcoordy(rast raster, xr int, yr int) +-- Test 9 - ST_RasterToworldcoordy(rast raster, xr int, yr int) ----------------------------------------------------------------------- SELECT 'test 9.1', id, name FROM rt_utility_test - WHERE COALESCE(st_raster2worldcoordy(rast, 1, 1), 0)::numeric != ipy::numeric; + WHERE COALESCE(ST_RasterToworldcoordy(rast, 1, 1), 0)::numeric != ipy::numeric; SELECT 'test 9.2', id, name FROM rt_utility_test - WHERE round(COALESCE(st_raster2worldcoordy(rast, width, height), 0)::numeric, 10) != round((skewy * (width - 1) + scaley * (height - 1) + ipy)::numeric, 10); + WHERE round(COALESCE(ST_RasterToworldcoordy(rast, width, height), 0)::numeric, 10) != round((skewy * (width - 1) + scaley * (height - 1) + ipy)::numeric, 10); ----------------------------------------------------------------------- --- Test 10 - st_raster2worldcoordy(rast raster, yr int) +-- Test 10 - ST_RasterToworldcoordy(rast raster, yr int) ----------------------------------------------------------------------- SELECT 'test 10.1', id, name FROM rt_utility_test - WHERE skewy = 0 and COALESCE(st_raster2worldcoordy(rast, 1, 1), 0)::numeric != ipy::numeric; + WHERE skewy = 0 and COALESCE(ST_RasterToworldcoordy(rast, 1, 1), 0)::numeric != ipy::numeric; SELECT 'test 10.2', id, name FROM rt_utility_test - WHERE skewy = 0 and COALESCE(st_raster2worldcoordy(rast, width, height), 0)::numeric != (scaley * (height - 1) + ipy)::numeric; + WHERE skewy = 0 and COALESCE(ST_RasterToworldcoordy(rast, width, height), 0)::numeric != (scaley * (height - 1) + ipy)::numeric; SELECT 'test 10.3', id, name FROM rt_utility_test - WHERE COALESCE(st_raster2worldcoordy(rast, 1), 0)::numeric != ipy::numeric; + WHERE COALESCE(ST_RasterToworldcoordy(rast, 1), 0)::numeric != ipy::numeric; ----------------------------------------------------------------------- -- Test 11 - st_minpossiblevalue(pixtype text) diff --git a/raster/test/regress/rt_world2rastercoord.sql b/raster/test/regress/rt_worldtorastercoord.sql similarity index 67% rename from raster/test/regress/rt_world2rastercoord.sql rename to raster/test/regress/rt_worldtorastercoord.sql index 75466192e..38b1679aa 100644 --- a/raster/test/regress/rt_world2rastercoord.sql +++ b/raster/test/regress/rt_worldtorastercoord.sql @@ -47,138 +47,138 @@ DROP FUNCTION make_test_raster(integer, integer, integer, double precision, doub SELECT rid, - (ST_World2RasterCoord(rast, -2, -2)).* + (ST_WorldToRasterCoord(rast, -2, -2)).* FROM raster_world2raster; SELECT rid, - (ST_World2RasterCoord(rast, 0, 0)).* + (ST_WorldToRasterCoord(rast, 0, 0)).* FROM raster_world2raster; SELECT rid, - (ST_World2RasterCoord(rast, 1, -1)).* + (ST_WorldToRasterCoord(rast, 1, -1)).* FROM raster_world2raster; SELECT rid, - (ST_World2RasterCoord(rast, 1, 1)).* + (ST_WorldToRasterCoord(rast, 1, 1)).* FROM raster_world2raster; SELECT rid, - (ST_World2RasterCoord(rast, 2, 2)).* + (ST_WorldToRasterCoord(rast, 2, 2)).* FROM raster_world2raster; SELECT rid, - (ST_World2RasterCoord(rast, ST_MakePoint(-2, -2))).* + (ST_WorldToRasterCoord(rast, ST_MakePoint(-2, -2))).* FROM raster_world2raster; SELECT rid, - (ST_World2RasterCoord(rast, ST_MakePoint(0, 0))).* + (ST_WorldToRasterCoord(rast, ST_MakePoint(0, 0))).* FROM raster_world2raster; SELECT rid, - (ST_World2RasterCoord(rast, ST_MakePoint(1, -1))).* + (ST_WorldToRasterCoord(rast, ST_MakePoint(1, -1))).* FROM raster_world2raster; SELECT rid, - (ST_World2RasterCoord(rast, ST_MakePoint(1, 1))).* + (ST_WorldToRasterCoord(rast, ST_MakePoint(1, 1))).* FROM raster_world2raster; SELECT rid, - (ST_World2RasterCoord(rast, ST_MakePoint(2, 2))).* + (ST_WorldToRasterCoord(rast, ST_MakePoint(2, 2))).* FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, -2, -2) + ST_WorldToRasterCoordX(rast, -2, -2) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, 0, 0) + ST_WorldToRasterCoordX(rast, 0, 0) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, 1, -1) + ST_WorldToRasterCoordX(rast, 1, -1) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, 1, 1) + ST_WorldToRasterCoordX(rast, 1, 1) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, 2, 2) + ST_WorldToRasterCoordX(rast, 2, 2) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, ST_MakePoint(-2, -2)) + ST_WorldToRasterCoordX(rast, ST_MakePoint(-2, -2)) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, -2) + ST_WorldToRasterCoordX(rast, -2) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, 0) + ST_WorldToRasterCoordX(rast, 0) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, 1) + ST_WorldToRasterCoordX(rast, 1) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, 1) + ST_WorldToRasterCoordX(rast, 1) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, 2) + ST_WorldToRasterCoordX(rast, 2) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordY(rast, -2, -2) + ST_WorldToRasterCoordY(rast, -2, -2) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordY(rast, 0, 0) + ST_WorldToRasterCoordY(rast, 0, 0) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordY(rast, 1, -1) + ST_WorldToRasterCoordY(rast, 1, -1) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordY(rast, 1, 1) + ST_WorldToRasterCoordY(rast, 1, 1) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordY(rast, 2, 2) + ST_WorldToRasterCoordY(rast, 2, 2) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordX(rast, ST_MakePoint(-2, -2)) + ST_WorldToRasterCoordX(rast, ST_MakePoint(-2, -2)) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordY(rast, -2) + ST_WorldToRasterCoordY(rast, -2) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordY(rast, 0) + ST_WorldToRasterCoordY(rast, 0) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordY(rast, 1) + ST_WorldToRasterCoordY(rast, 1) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordY(rast, 1) + ST_WorldToRasterCoordY(rast, 1) FROM raster_world2raster; SELECT rid, - ST_World2RasterCoordY(rast, 2) + ST_WorldToRasterCoordY(rast, 2) FROM raster_world2raster; DROP TABLE raster_world2raster; diff --git a/raster/test/regress/rt_world2rastercoord_expected b/raster/test/regress/rt_worldtorastercoord_expected similarity index 100% rename from raster/test/regress/rt_world2rastercoord_expected rename to raster/test/regress/rt_worldtorastercoord_expected