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 *
</refsection>
</refentry>
- <refentry id="RT_ST_Raster2WorldCoord">
+ <refentry id="RT_ST_RasterToWorldCoord">
<refnamediv>
- <refname>ST_Raster2WorldCoord</refname>
+ <refname>ST_RasterToWorldCoord</refname>
<refpurpose>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.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>record <function>ST_Raster2WorldCoord</function></funcdef>
+ <funcdef>record <function>ST_RasterToWorldCoord</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>integer </type> <parameter>xcolumn</parameter></paramdef>
<paramdef><type>integer </type> <parameter>yrow</parameter></paramdef>
-- 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
-- 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,
<refsection>
<title>See Also</title>
<para>
- <xref linkend="RT_ST_Raster2WorldCoordX" />,
- <xref linkend="RT_ST_Raster2WorldCoordY" />,
+ <xref linkend="RT_ST_RasterToWorldCoordX" />,
+ <xref linkend="RT_ST_RasterToWorldCoordY" />,
<xref linkend="RT_ST_SetSkew" />
</para>
</refsection>
</refentry>
- <refentry id="RT_ST_Raster2WorldCoordX">
+ <refentry id="RT_ST_RasterToWorldCoordX">
<refnamediv>
- <refname>ST_Raster2WorldCoordX</refname>
+ <refname>ST_RasterToWorldCoordX</refname>
<refpurpose>Returns the geometric X coordinate upper left of a raster, column and row. Numbering of columns
and rows starts at 1.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>float8 <function>ST_Raster2WorldCoordX</function></funcdef>
+ <funcdef>float8 <function>ST_RasterToWorldCoordX</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>integer </type> <parameter>xcolumn</parameter></paramdef>
</funcprototype>
<funcprototype>
- <funcdef>float8 <function>ST_Raster2WorldCoordX</function></funcdef>
+ <funcdef>float8 <function>ST_RasterToWorldCoordX</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>integer </type> <parameter>xcolumn</parameter></paramdef>
<paramdef><type>integer </type> <parameter>yrow</parameter></paramdef>
<note><para>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.</para></note>
+
+ <para>Changed: 2.1.0 In prior versions, this was called ST_Raster2WorldCoordX</para>
+
</refsection>
<refsection>
<programlisting>
-- 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;
<programlisting>
-- 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;
<!-- Optionally add a "See Also" section -->
<refsection>
<title>See Also</title>
- <para><xref linkend="RT_ST_ScaleX" />, <xref linkend="RT_ST_Raster2WorldCoordY" />, <xref linkend="RT_ST_SetSkew" />, <xref linkend="RT_ST_SkewX" /></para>
+ <para><xref linkend="RT_ST_ScaleX" />, <xref linkend="RT_ST_RasterToWorldCoordY" />, <xref linkend="RT_ST_SetSkew" />, <xref linkend="RT_ST_SkewX" /></para>
</refsection>
</refentry>
- <refentry id="RT_ST_Raster2WorldCoordY">
+ <refentry id="RT_ST_RasterToWorldCoordY">
<refnamediv>
- <refname>ST_Raster2WorldCoordY</refname>
+ <refname>ST_RasterToWorldCoordY</refname>
<refpurpose>Returns the geometric Y coordinate upper left corner of a raster, column and row. Numbering of columns
and rows starts at 1. </refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>float8 <function>ST_Raster2WorldCoordY</function></funcdef>
+ <funcdef>float8 <function>ST_RasterToWorldCoordY</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>integer </type> <parameter>yrow</parameter></paramdef>
</funcprototype>
<funcprototype>
- <funcdef>float8 <function>ST_Raster2WorldCoordY</function></funcdef>
+ <funcdef>float8 <function>ST_RasterToWorldCoordY</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>integer </type> <parameter>xcolumn</parameter></paramdef>
<paramdef><type>integer </type> <parameter>yrow</parameter></paramdef>
<note><para>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.</para></note>
+
+ <para>Changed: 2.1.0 In prior versions, this was called ST_Raster2WorldCoordY</para>
</refsection>
<refsection>
<programlisting>
-- 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;
<programlisting>
-- 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;
<!-- Optionally add a "See Also" section -->
<refsection>
<title>See Also</title>
- <para><xref linkend="RT_ST_ScaleY" />, <xref linkend="RT_ST_Raster2WorldCoordX" />, <xref linkend="RT_ST_SetSkew" />, <xref linkend="RT_ST_SkewY" /></para>
+ <para><xref linkend="RT_ST_ScaleY" />, <xref linkend="RT_ST_RasterToWorldCoordX" />, <xref linkend="RT_ST_SetSkew" />, <xref linkend="RT_ST_SkewY" /></para>
</refsection>
</refentry>
</refentry>
- <refentry id="RT_ST_World2RasterCoord">
+ <refentry id="RT_ST_WorldToRasterCoord">
<refnamediv>
- <refname>ST_World2RasterCoord</refname>
+ <refname>ST_WorldToRasterCoord</refname>
<refpurpose> 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.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>integer <function>ST_World2RasterCoord</function></funcdef>
+ <funcdef>integer <function>ST_WorldToRasterCoord</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>geometry </type> <parameter>pt</parameter></paramdef>
</funcprototype>
<funcprototype>
- <funcdef>integer <function>ST_World2RasterCoord</function></funcdef>
+ <funcdef>integer <function>ST_WorldToRasterCoord</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>double precision </type> <parameter>longitude</parameter></paramdef>
<paramdef><type>double precision </type> <parameter>latitude</parameter></paramdef>
<programlisting>
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
<refsection>
<title>See Also</title>
<para>
- <xref linkend="RT_ST_World2RasterCoordX" />,
- <xref linkend="RT_ST_World2RasterCoordY" />,
- <xref linkend="RT_ST_Raster2WorldCoordX" />,
- <xref linkend="RT_ST_Raster2WorldCoordY" />,
+ <xref linkend="RT_ST_WorldToRasterCoordX" />,
+ <xref linkend="RT_ST_WorldToRasterCoordY" />,
+ <xref linkend="RT_ST_RasterToWorldCoordX" />,
+ <xref linkend="RT_ST_RasterToWorldCoordY" />,
<xref linkend="RT_ST_SRID" />
</para>
</refsection>
</refentry>
- <refentry id="RT_ST_World2RasterCoordX">
+ <refentry id="RT_ST_WorldToRasterCoordX">
<refnamediv>
- <refname>ST_World2RasterCoordX</refname>
+ <refname>ST_WorldToRasterCoordX</refname>
<refpurpose>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.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>integer <function>ST_World2RasterCoordX</function></funcdef>
+ <funcdef>integer <function>ST_WorldToRasterCoordX</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>geometry </type> <parameter>pt</parameter></paramdef>
</funcprototype>
<funcprototype>
- <funcdef>integer <function>ST_World2RasterCoordX</function></funcdef>
+ <funcdef>integer <function>ST_WorldToRasterCoordX</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>double precision </type> <parameter>xw</parameter></paramdef>
</funcprototype>
<funcprototype>
- <funcdef>integer <function>ST_World2RasterCoordX</function></funcdef>
+ <funcdef>integer <function>ST_WorldToRasterCoordX</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>double precision </type> <parameter>xw</parameter></paramdef>
<paramdef><type>double precision </type> <parameter>yw</parameter></paramdef>
<para>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.</para>
+ <para>Changed: 2.1.0 In prior versions, this was called ST_World2RasterCoordX</para>
</refsection>
<refsection>
<title>Examples</title>
- <programlisting>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
+ <programlisting>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
<refsection>
<title>See Also</title>
<para>
- <xref linkend="RT_ST_Raster2WorldCoordX" />,
- <xref linkend="RT_ST_Raster2WorldCoordY" />,
+ <xref linkend="RT_ST_RasterToWorldCoordX" />,
+ <xref linkend="RT_ST_RasterToWorldCoordY" />,
<xref linkend="RT_ST_SRID" />
</para>
</refsection>
</refentry>
- <refentry id="RT_ST_World2RasterCoordY">
+ <refentry id="RT_ST_WorldToRasterCoordY">
<refnamediv>
- <refname>ST_World2RasterCoordY</refname>
+ <refname>ST_WorldToRasterCoordY</refname>
<refpurpose>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.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
- <funcdef>integer <function>ST_World2RasterCoordY</function></funcdef>
+ <funcdef>integer <function>ST_WorldToRasterCoordY</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>geometry </type> <parameter>pt</parameter></paramdef>
</funcprototype>
<funcprototype>
- <funcdef>integer <function>ST_World2RasterCoordY</function></funcdef>
+ <funcdef>integer <function>ST_WorldToRasterCoordY</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>double precision </type> <parameter>xw</parameter></paramdef>
</funcprototype>
<funcprototype>
- <funcdef>integer <function>ST_World2RasterCoordY</function></funcdef>
+ <funcdef>integer <function>ST_WorldToRasterCoordY</function></funcdef>
<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>
<paramdef><type>double precision </type> <parameter>xw</parameter></paramdef>
<paramdef><type>double precision </type> <parameter>yw</parameter></paramdef>
<para>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.</para>
+ <para>Changed: 2.1.0 In prior versions, this was called ST_World2RasterCoordY</para>
</refsection>
<refsection>
<title>Examples</title>
- <programlisting>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
+ <programlisting>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
<!-- Optionally add a "See Also" section -->
<refsection>
<title>See Also</title>
- <para><xref linkend="RT_ST_Raster2WorldCoordX" />, <xref linkend="RT_ST_Raster2WorldCoordY" />, <xref linkend="RT_ST_SRID" /></para>
+ <para><xref linkend="RT_ST_RasterToWorldCoordX" />, <xref linkend="RT_ST_RasterToWorldCoordY" />, <xref linkend="RT_ST_SRID" /></para>
</refsection>
</refentry>
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;
$$
-----------------------------------------------------------------------
-----------------------------------------------------------------------
--- 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,
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
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
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
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,
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
-- 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
-- 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;
-----------------------------------------------------------------------
--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;
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(
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;
-----------------------------------------------------------------------
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;
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);
-- 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);
rt_isempty \
rt_hasnoband \
rt_metadata \
- rt_raster2worldcoord \
- rt_world2rastercoord
+ rt_rastertoworldcoord \
+ rt_worldtorastercoord
TEST_BANDPROPS = \
rt_band_properties \
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
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
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
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
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
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
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;
);
-----------------------------------------------------------------------
--- 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
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
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
), 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
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
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
), 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)
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;