mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-24 00:52:40 +00:00
Addition of ST_PixelAsPoints and ST_PixelAsCentroids
git-svn-id: http://svn.osgeo.org/postgis/trunk@10024 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
parent
a643daa98b
commit
d4f05e108b
|
@ -2532,7 +2532,7 @@ CREATE OR REPLACE FUNCTION st_pixelaspolygons(
|
|||
LANGUAGE 'sql' IMMUTABLE STRICT;
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- ST_PixelAsPolygons
|
||||
-- ST_PixelAsPolygon
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
CREATE OR REPLACE FUNCTION st_pixelaspolygon(rast raster, x integer, y integer)
|
||||
|
@ -2540,6 +2540,58 @@ CREATE OR REPLACE FUNCTION st_pixelaspolygon(rast raster, x integer, y integer)
|
|||
AS $$ SELECT geom FROM _st_pixelaspolygons($1, NULL, $2, $3) $$
|
||||
LANGUAGE 'sql' IMMUTABLE STRICT;
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- ST_PixelAsPoints
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
CREATE OR REPLACE FUNCTION st_pixelaspoints(
|
||||
rast raster,
|
||||
band integer DEFAULT 1,
|
||||
exclude_nodata_value boolean DEFAULT TRUE,
|
||||
OUT geom geometry,
|
||||
OUT val double precision,
|
||||
OUT x int,
|
||||
OUT y int
|
||||
)
|
||||
RETURNS SETOF record
|
||||
AS $$ SELECT ST_PointN(ST_ExteriorRing(geom), 1), val, x, y FROM _st_pixelaspolygons($1, $2, NULL, NULL, $3) $$
|
||||
LANGUAGE 'sql' IMMUTABLE STRICT;
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- ST_PixelAsPoint
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
CREATE OR REPLACE FUNCTION st_pixelaspoint(rast raster, x integer, y integer)
|
||||
RETURNS geometry
|
||||
AS $$ SELECT ST_PointN(ST_ExteriorRing(geom), 1) FROM _st_pixelaspolygons($1, NULL, $2, $3) $$
|
||||
LANGUAGE 'sql' IMMUTABLE STRICT;
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- ST_PixelAsCentroids
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
CREATE OR REPLACE FUNCTION st_pixelascentroids(
|
||||
rast raster,
|
||||
band integer DEFAULT 1,
|
||||
exclude_nodata_value boolean DEFAULT TRUE,
|
||||
OUT geom geometry,
|
||||
OUT val double precision,
|
||||
OUT x int,
|
||||
OUT y int
|
||||
)
|
||||
RETURNS SETOF record
|
||||
AS $$ SELECT ST_Centroid(geom), val, x, y FROM _st_pixelaspolygons($1, $2, NULL, NULL, $3) $$
|
||||
LANGUAGE 'sql' IMMUTABLE STRICT;
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- ST_PixelAsCentroid
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
CREATE OR REPLACE FUNCTION st_pixelascentroid(rast raster, x integer, y integer)
|
||||
RETURNS geometry
|
||||
AS $$ SELECT ST_Centroid(geom) FROM _st_pixelaspolygons($1, NULL, $2, $3) $$
|
||||
LANGUAGE 'sql' IMMUTABLE STRICT;
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- Raster Utility Functions
|
||||
-----------------------------------------------------------------------
|
||||
|
|
|
@ -83,7 +83,9 @@ TEST_BANDPROPS = \
|
|||
rt_neighborhood \
|
||||
rt_nearestvalue \
|
||||
rt_pixelofvalue \
|
||||
rt_pixelaspolygons.sql
|
||||
rt_pixelaspolygons \
|
||||
rt_pixelaspoints \
|
||||
rt_pixelascentroids
|
||||
|
||||
TEST_UTILITY = \
|
||||
rt_utility \
|
||||
|
|
Loading…
Reference in a new issue